Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1208201 > unrolled thread

[PATCH 1/3] staging: wilc1000: code style: fix macro with multiple statements

Started byRaphaël Beamonte <raphael.beamonte@gmail.com>
First post2015-08-16 07:40 +0200
Last post2015-08-17 21:40 +0200
Articles 10 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 1/3] staging: wilc1000: code style: fix macro with multiple statements Raphaël Beamonte <raphael.beamonte@gmail.com> - 2015-08-16 07:40 +0200
    Re: [PATCH 1/3] staging: wilc1000: code style: fix macro with  multiple statements Dan Carpenter <dan.carpenter@oracle.com> - 2015-08-17 11:10 +0200
      Re: [PATCH 1/3] staging: wilc1000: code style: fix macro with  multiple statements Raphaël Beamonte <raphael.beamonte@gmail.com> - 2015-08-17 16:50 +0200
        [PATCH 0/5] staging: wilc1000: code improvements Raphaël Beamonte <raphael.beamonte@gmail.com> - 2015-08-17 18:10 +0200
          [PATCH 5/5] staging: wilc1000: remove void function return statements that are not useful Raphaël Beamonte <raphael.beamonte@gmail.com> - 2015-08-17 18:10 +0200
          [PATCH 2/5] staging: wilc1000: remove FREE_WILC_BUFFER() Raphaël Beamonte <raphael.beamonte@gmail.com> - 2015-08-17 18:20 +0200
            Re: [PATCH 2/5] staging: wilc1000: remove FREE_WILC_BUFFER() Dan Carpenter <dan.carpenter@oracle.com> - 2015-08-17 19:50 +0200
          [PATCHv2 0/5] staging: wilc1000: code improvements Raphaël Beamonte <raphael.beamonte@gmail.com> - 2015-08-17 21:30 +0200
            [PATCHv2 1/5] staging: wilc1000: remove void function return statements that are not useful Raphaël Beamonte <raphael.beamonte@gmail.com> - 2015-08-17 21:30 +0200
            [PATCHv2 3/5] staging: wilc1000: remove DECLARE_WILC_BUFFER() Raphaël Beamonte <raphael.beamonte@gmail.com> - 2015-08-17 21:40 +0200

#1208201 — [PATCH 1/3] staging: wilc1000: code style: fix macro with multiple statements

FromRaphaël Beamonte <raphael.beamonte@gmail.com>
Date2015-08-16 07:40 +0200
Subject[PATCH 1/3] staging: wilc1000: code style: fix macro with multiple statements
Message-ID<pXYPL-7Bh-1@gated-at.bofh.it>
Macros with multiple statements should be enclosed in a do - while loop

Signed-off-by: Raphaël Beamonte <raphael.beamonte@gmail.com>
---
 drivers/staging/wilc1000/wilc_exported_buf.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_exported_buf.c b/drivers/staging/wilc1000/wilc_exported_buf.c
index 5294578..45c2c7e 100644
--- a/drivers/staging/wilc1000/wilc_exported_buf.c
+++ b/drivers/staging/wilc1000/wilc_exported_buf.c
@@ -12,11 +12,13 @@
 	void *exported_ ## name = NULL;
 
 #define MALLOC_WILC_BUFFER(name, size)	\
-	exported_ ## name = kmalloc(size, GFP_KERNEL);	  \
-	if (!exported_ ## name) {   \
-		printk("fail to alloc: %s memory\n", exported_ ## name);  \
-		return -ENOBUFS;	\
-	}
+	do { \
+		exported_ ## name = kmalloc(size, GFP_KERNEL);	  \
+		if (!exported_ ## name) {   \
+			printk("fail to alloc: %s memory\n", exported_ ## name);  \
+			return -ENOBUFS;	\
+		}
+	} while (0)
 
 #define FREE_WILC_BUFFER(name)	\
 	kfree(exported_ ## name);
@@ -73,4 +75,4 @@ MODULE_LICENSE("Dual BSD/GPL");
 MODULE_AUTHOR("Tony Cho");
 MODULE_DESCRIPTION("WILC1xxx Memory Manager");
 pure_initcall(wilc_module_init);
-module_exit(wilc_module_deinit);
\ No newline at end of file
+module_exit(wilc_module_deinit);
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1208484 — Re: [PATCH 1/3] staging: wilc1000: code style: fix macro with multiple statements

FromDan Carpenter <dan.carpenter@oracle.com>
Date2015-08-17 11:10 +0200
SubjectRe: [PATCH 1/3] staging: wilc1000: code style: fix macro with multiple statements
Message-ID<pYoAy-2Ok-5@gated-at.bofh.it>
In reply to#1208201
On Sun, Aug 16, 2015 at 01:30:12AM -0400, Raphaël Beamonte wrote:
>  #define MALLOC_WILC_BUFFER(name, size)	\
> -	exported_ ## name = kmalloc(size, GFP_KERNEL);	  \
> -	if (!exported_ ## name) {   \
> -		printk("fail to alloc: %s memory\n", exported_ ## name);  \
> -		return -ENOBUFS;	\
> -	}
> +	do { \
> +		exported_ ## name = kmalloc(size, GFP_KERNEL);	  \
> +		if (!exported_ ## name) {   \
> +			printk("fail to alloc: %s memory\n", exported_ ## name);  \
> +			return -ENOBUFS;	\
> +		}
> +	} while (0)

Pull it in one indent level...  But actually this macro has a return in
the middle of it, so it just introduces bugs all over the place like
eating cookies in bed.  We should just delete it instead.

regards,
dan carpenter

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1208628 — Re: [PATCH 1/3] staging: wilc1000: code style: fix macro with multiple statements

FromRaphaël Beamonte <raphael.beamonte@gmail.com>
Date2015-08-17 16:50 +0200
SubjectRe: [PATCH 1/3] staging: wilc1000: code style: fix macro with multiple statements
Message-ID<pYtTA-1QB-13@gated-at.bofh.it>
In reply to#1208484
2015-08-17 5:08 GMT-04:00 Dan Carpenter <dan.carpenter@oracle.com>:
> Pull it in one indent level...  But actually this macro has a return in
> the middle of it, so it just introduces bugs all over the place like
> eating cookies in bed.  We should just delete it instead.

You're right!
I'll clean those macro up and send a new set of patches to replace this one.

Thanks for the feedback!
Raphaël
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1208684 — [PATCH 0/5] staging: wilc1000: code improvements

FromRaphaël Beamonte <raphael.beamonte@gmail.com>
Date2015-08-17 18:10 +0200
Subject[PATCH 0/5] staging: wilc1000: code improvements
Message-ID<pYv8Z-3OC-7@gated-at.bofh.it>
In reply to#1208628
Hi,

The first 3 patches of the following 5 are aimed to simplify the
wilc_exported_buf.c macros as well as correct a potential memory
leak from the use of the MALLOC_WILC_BUFFER one.

The next 2 patches are correcting two kind of checkpatch warning
reports in different files of the wilc1000 driver.

Raphaël


Raphaël Beamonte (5):
  staging: wilc1000: remove DECLARE_WILC_BUFFER()
  staging: wilc1000: remove FREE_WILC_BUFFER()
  staging: wilc1000: replace MALLOC_WILC_BUFFER() macro to avoid
    possible memory leak
  staging: wilc1000: use pr_* instead of printk
  staging: wilc1000: remove void function return statements that are not
    useful

 drivers/staging/wilc1000/coreconfigurator.c  |  4 +-
 drivers/staging/wilc1000/host_interface.c    |  4 --
 drivers/staging/wilc1000/linux_wlan.c        |  9 ++--
 drivers/staging/wilc1000/linux_wlan_common.h | 32 ++++++-------
 drivers/staging/wilc1000/linux_wlan_sdio.c   |  2 +-
 drivers/staging/wilc1000/linux_wlan_spi.c    |  2 +-
 drivers/staging/wilc1000/wilc_debugfs.c      | 16 +++----
 drivers/staging/wilc1000/wilc_exported_buf.c | 69 +++++++++++++++++-----------
 drivers/staging/wilc1000/wilc_wlan.c         |  3 --
 drivers/staging/wilc1000/wilc_wlan_cfg.c     |  2 -
 10 files changed, 75 insertions(+), 68 deletions(-)

-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1208686 — [PATCH 5/5] staging: wilc1000: remove void function return statements that are not useful

FromRaphaël Beamonte <raphael.beamonte@gmail.com>
Date2015-08-17 18:10 +0200
Subject[PATCH 5/5] staging: wilc1000: remove void function return statements that are not useful
Message-ID<pYv90-3OC-25@gated-at.bofh.it>
In reply to#1208684
Signed-off-by: Raphaël Beamonte <raphael.beamonte@gmail.com>
---
 drivers/staging/wilc1000/host_interface.c    | 4 ----
 drivers/staging/wilc1000/linux_wlan.c        | 1 -
 drivers/staging/wilc1000/wilc_exported_buf.c | 2 --
 drivers/staging/wilc1000/wilc_wlan.c         | 3 ---
 drivers/staging/wilc1000/wilc_wlan_cfg.c     | 2 --
 5 files changed, 12 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 53c4ca9..a000eaf 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -6779,9 +6779,6 @@ void NetworkInfoReceived(u8 *pu8Buffer, u32 u32Length)
 	s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), NULL);
 	if (s32Error)
 		PRINT_ER("Error in sending network info message queue message parameters: Error(%d)\n", s32Error);
-
-
-	return;
 }
 
 /**
@@ -6845,7 +6842,6 @@ void GnrlAsyncInfoReceived(u8 *pu8Buffer, u32 u32Length)
 
 	/*BugID_5348*/
 	up(&hSemHostIntDeinit);
-	return;
 }
 
 /**
diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index 1f32c36..507aab6 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -1385,7 +1385,6 @@ void wilc1000_wlan_deinit(linux_wlan_t *nic)
 	} else {
 		PRINT_D(INIT_DBG, "wilc1000 is not initialized\n");
 	}
-	return;
 }
 
 int wlan_init_locks(linux_wlan_t *p_nic)
diff --git a/drivers/staging/wilc1000/wilc_exported_buf.c b/drivers/staging/wilc1000/wilc_exported_buf.c
index ceacfe2..3f07852 100644
--- a/drivers/staging/wilc1000/wilc_exported_buf.c
+++ b/drivers/staging/wilc1000/wilc_exported_buf.c
@@ -84,8 +84,6 @@ static void __exit wilc_module_deinit(void)
 
 	kfree(exported_g_fw_buf);
 	exported_g_fw_buf = NULL;
-
-	return;
 }
 
 MODULE_LICENSE("Dual BSD/GPL");
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index 4c40955..e9552f8 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -124,8 +124,6 @@ static void wilc_debug(uint32_t flag, char *fmt, ...)
 		if (g_wlan.os_func.os_debug)
 			g_wlan.os_func.os_debug(buf);
 	}
-
-	return;
 }
 
 static CHIP_PS_STATE_T genuChipPSstate = CHIP_WAKEDUP;
@@ -1325,7 +1323,6 @@ static void wilc_wlan_handle_rxq(void)
 
 	p->rxq_exit = 1;
 	PRINT_D(RX_DBG, "THREAD: Exiting RX thread\n");
-	return;
 }
 
 /********************************************
diff --git a/drivers/staging/wilc1000/wilc_wlan_cfg.c b/drivers/staging/wilc1000/wilc_wlan_cfg.c
index c10dffe..e2842d3 100644
--- a/drivers/staging/wilc1000/wilc_wlan_cfg.c
+++ b/drivers/staging/wilc1000/wilc_wlan_cfg.c
@@ -363,8 +363,6 @@ static void wilc_wlan_parse_response_frame(uint8_t *info, int size)
 		size -= (2 + len);
 		info += (2 + len);
 	}
-
-	return;
 }
 
 static int wilc_wlan_parse_info_frame(uint8_t *info, int size)
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1208693 — [PATCH 2/5] staging: wilc1000: remove FREE_WILC_BUFFER()

FromRaphaël Beamonte <raphael.beamonte@gmail.com>
Date2015-08-17 18:20 +0200
Subject[PATCH 2/5] staging: wilc1000: remove FREE_WILC_BUFFER()
Message-ID<pYviH-402-25@gated-at.bofh.it>
In reply to#1208684
It was just a wrapper around kfree(), so call that instead.

Signed-off-by: Raphaël Beamonte <raphael.beamonte@gmail.com>
---
 drivers/staging/wilc1000/wilc_exported_buf.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_exported_buf.c b/drivers/staging/wilc1000/wilc_exported_buf.c
index 985b0e1..bf392fb 100644
--- a/drivers/staging/wilc1000/wilc_exported_buf.c
+++ b/drivers/staging/wilc1000/wilc_exported_buf.c
@@ -15,9 +15,6 @@
 		return -ENOBUFS;	\
 	}
 
-#define FREE_WILC_BUFFER(name)	\
-	kfree(exported_ ## name);
-
 /*
  * Add necessary buffer pointers
  */
@@ -59,9 +56,15 @@ static int __init wilc_module_init(void)
 static void __exit wilc_module_deinit(void)
 {
 	printk("wilc_module_deinit\n");
-	FREE_WILC_BUFFER(g_tx_buf)
-	FREE_WILC_BUFFER(g_rx_buf)
-	FREE_WILC_BUFFER(g_fw_buf)
+
+	kfree(exported_g_tx_buf);
+	exported_g_tx_buf = NULL;
+
+	kfree(exported_g_rx_buf);
+	exported_g_rx_buf = NULL;
+
+	kfree(exported_g_fw_buf);
+	exported_g_fw_buf = NULL;
 
 	return;
 }
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1208758 — Re: [PATCH 2/5] staging: wilc1000: remove FREE_WILC_BUFFER()

FromDan Carpenter <dan.carpenter@oracle.com>
Date2015-08-17 19:50 +0200
SubjectRe: [PATCH 2/5] staging: wilc1000: remove FREE_WILC_BUFFER()
Message-ID<pYwHL-5TN-9@gated-at.bofh.it>
In reply to#1208693
On Mon, Aug 17, 2015 at 12:08:34PM -0400, Raphaël Beamonte wrote:
> It was just a wrapper around kfree(), so call that instead.
> 
> Signed-off-by: Raphaël Beamonte <raphael.beamonte@gmail.com>
> ---
> +	kfree(exported_g_tx_buf);
> +	exported_g_tx_buf = NULL;

No need to add these new NULL assignments.  The module is unloading so
no one cat re-use these pointers.  Also as a process rule, you should
write down any behaviour changes in the changelog and why you think they
are needed.

regards,
dan carpenter

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1208828 — [PATCHv2 0/5] staging: wilc1000: code improvements

FromRaphaël Beamonte <raphael.beamonte@gmail.com>
Date2015-08-17 21:30 +0200
Subject[PATCHv2 0/5] staging: wilc1000: code improvements
Message-ID<pYygy-8f8-11@gated-at.bofh.it>
In reply to#1208684
Hi,

Following comments from Dan Carpenter, please find the following
revised patches.

Raphaël


Raphaël Beamonte (5):
  staging: wilc1000: remove void function return statements that are not
    useful
  staging: wilc1000: use pr_* instead of printk
  staging: wilc1000: remove DECLARE_WILC_BUFFER()
  staging: wilc1000: remove FREE_WILC_BUFFER()
  staging: wilc1000: replace MALLOC_WILC_BUFFER() macro to avoid
    possible memory leak

 drivers/staging/wilc1000/coreconfigurator.c  |  4 +-
 drivers/staging/wilc1000/host_interface.c    |  4 --
 drivers/staging/wilc1000/linux_wlan.c        |  9 ++--
 drivers/staging/wilc1000/linux_wlan_common.h | 28 ++++++-------
 drivers/staging/wilc1000/linux_wlan_sdio.c   |  2 +-
 drivers/staging/wilc1000/linux_wlan_spi.c    |  2 +-
 drivers/staging/wilc1000/wilc_debugfs.c      | 16 ++++----
 drivers/staging/wilc1000/wilc_exported_buf.c | 61 ++++++++++++++++------------
 drivers/staging/wilc1000/wilc_wlan.c         |  3 --
 drivers/staging/wilc1000/wilc_wlan_cfg.c     |  2 -
 10 files changed, 64 insertions(+), 67 deletions(-)

-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1208830 — [PATCHv2 1/5] staging: wilc1000: remove void function return statements that are not useful

FromRaphaël Beamonte <raphael.beamonte@gmail.com>
Date2015-08-17 21:30 +0200
Subject[PATCHv2 1/5] staging: wilc1000: remove void function return statements that are not useful
Message-ID<pYygy-8f8-29@gated-at.bofh.it>
In reply to#1208828
Signed-off-by: Raphaël Beamonte <raphael.beamonte@gmail.com>
---
 drivers/staging/wilc1000/host_interface.c    | 4 ----
 drivers/staging/wilc1000/linux_wlan.c        | 1 -
 drivers/staging/wilc1000/wilc_exported_buf.c | 4 +---
 drivers/staging/wilc1000/wilc_wlan.c         | 3 ---
 drivers/staging/wilc1000/wilc_wlan_cfg.c     | 2 --
 5 files changed, 1 insertion(+), 13 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index c473877..0cfc97d 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -6782,9 +6782,6 @@ void NetworkInfoReceived(u8 *pu8Buffer, u32 u32Length)
 	s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
 	if (s32Error)
 		PRINT_ER("Error in sending network info message queue message parameters: Error(%d)\n", s32Error);
-
-
-	return;
 }
 
 /**
@@ -6848,7 +6845,6 @@ void GnrlAsyncInfoReceived(u8 *pu8Buffer, u32 u32Length)
 
 	/*BugID_5348*/
 	up(&hSemHostIntDeinit);
-	return;
 }
 
 /**
diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index 7eacc2f..e6e8a20 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -1385,7 +1385,6 @@ void wilc1000_wlan_deinit(linux_wlan_t *nic)
 	} else {
 		PRINT_D(INIT_DBG, "wilc1000 is not initialized\n");
 	}
-	return;
 }
 
 int wlan_init_locks(linux_wlan_t *p_nic)
diff --git a/drivers/staging/wilc1000/wilc_exported_buf.c b/drivers/staging/wilc1000/wilc_exported_buf.c
index 5294578..deba6bd 100644
--- a/drivers/staging/wilc1000/wilc_exported_buf.c
+++ b/drivers/staging/wilc1000/wilc_exported_buf.c
@@ -65,12 +65,10 @@ static void __exit wilc_module_deinit(void)
 	FREE_WILC_BUFFER(g_tx_buf)
 	FREE_WILC_BUFFER(g_rx_buf)
 	FREE_WILC_BUFFER(g_fw_buf)
-
-	return;
 }
 
 MODULE_LICENSE("Dual BSD/GPL");
 MODULE_AUTHOR("Tony Cho");
 MODULE_DESCRIPTION("WILC1xxx Memory Manager");
 pure_initcall(wilc_module_init);
-module_exit(wilc_module_deinit);
\ No newline at end of file
+module_exit(wilc_module_deinit);
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index fac16db..7c53a2b 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -124,8 +124,6 @@ static void wilc_debug(uint32_t flag, char *fmt, ...)
 		if (g_wlan.os_func.os_debug)
 			g_wlan.os_func.os_debug(buf);
 	}
-
-	return;
 }
 
 static CHIP_PS_STATE_T genuChipPSstate = CHIP_WAKEDUP;
@@ -1325,7 +1323,6 @@ static void wilc_wlan_handle_rxq(void)
 
 	p->rxq_exit = 1;
 	PRINT_D(RX_DBG, "THREAD: Exiting RX thread\n");
-	return;
 }
 
 /********************************************
diff --git a/drivers/staging/wilc1000/wilc_wlan_cfg.c b/drivers/staging/wilc1000/wilc_wlan_cfg.c
index c10dffe..e2842d3 100644
--- a/drivers/staging/wilc1000/wilc_wlan_cfg.c
+++ b/drivers/staging/wilc1000/wilc_wlan_cfg.c
@@ -363,8 +363,6 @@ static void wilc_wlan_parse_response_frame(uint8_t *info, int size)
 		size -= (2 + len);
 		info += (2 + len);
 	}
-
-	return;
 }
 
 static int wilc_wlan_parse_info_frame(uint8_t *info, int size)
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1208834 — [PATCHv2 3/5] staging: wilc1000: remove DECLARE_WILC_BUFFER()

FromRaphaël Beamonte <raphael.beamonte@gmail.com>
Date2015-08-17 21:40 +0200
Subject[PATCHv2 3/5] staging: wilc1000: remove DECLARE_WILC_BUFFER()
Message-ID<pYyqe-8ql-3@gated-at.bofh.it>
In reply to#1208828
It was just a wrapper to initialize a variable. Initialize it
directly instead.

Signed-off-by: Raphaël Beamonte <raphael.beamonte@gmail.com>
---
 drivers/staging/wilc1000/wilc_exported_buf.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_exported_buf.c b/drivers/staging/wilc1000/wilc_exported_buf.c
index 55b6232..148d608 100644
--- a/drivers/staging/wilc1000/wilc_exported_buf.c
+++ b/drivers/staging/wilc1000/wilc_exported_buf.c
@@ -8,9 +8,6 @@
 #define LINUX_TX_SIZE	(64 * 1024)
 #define WILC1000_FW_SIZE (4 * 1024)
 
-#define DECLARE_WILC_BUFFER(name)	\
-	void *exported_ ## name = NULL;
-
 #define MALLOC_WILC_BUFFER(name, size)	\
 	exported_ ## name = kmalloc(size, GFP_KERNEL);	  \
 	if (!exported_ ## name) {   \
@@ -24,9 +21,9 @@
 /*
  * Add necessary buffer pointers
  */
-DECLARE_WILC_BUFFER(g_tx_buf)
-DECLARE_WILC_BUFFER(g_rx_buf)
-DECLARE_WILC_BUFFER(g_fw_buf)
+void *exported_g_tx_buf;
+void *exported_g_rx_buf;
+void *exported_g_fw_buf;
 
 void *get_tx_buffer(void)
 {
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web