All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHv2 4/5] staging: wlags49_h2: Correct macro style in wl_netdev.c
@ 2014-03-19 22:56 Mathieu Maret
  2014-03-20  1:53 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Mathieu Maret @ 2014-03-19 22:56 UTC (permalink / raw)
  To: pe1dnn, gregkh; +Cc: devel, linux-kernel, Mathieu Maret

Multi statement macro should use do{}while(0)

patch v2 does not break compilation
---
 drivers/staging/wlags49_h2/wl_netdev.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wlags49_h2/wl_netdev.c b/drivers/staging/wlags49_h2/wl_netdev.c
index 255d291..0e553ae 100644
--- a/drivers/staging/wlags49_h2/wl_netdev.c
+++ b/drivers/staging/wlags49_h2/wl_netdev.c
@@ -107,9 +107,11 @@
  * macros
  ******************************************************************************/
 #define BLOCK_INPUT(buf, len) \
-    desc->buf_addr = buf; \
-    desc->BUF_SIZE = len; \
-    status = hcf_rcv_msg(&(lp->hcfCtx), desc, 0)
+	do { \
+		desc->buf_addr = buf; \
+		desc->BUF_SIZE = len; \
+		status = hcf_rcv_msg(&(lp->hcfCtx), desc, 0); \
+	} while (0)
 
 #define BLOCK_INPUT_DMA(buf, len) memcpy( buf, desc_next->buf_addr, pktlen )
 
-- 
1.9.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCHv2 4/5] staging: wlags49_h2: Correct macro style in wl_netdev.c
  2014-03-19 22:56 [PATCHv2 4/5] staging: wlags49_h2: Correct macro style in wl_netdev.c Mathieu Maret
@ 2014-03-20  1:53 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2014-03-20  1:53 UTC (permalink / raw)
  To: Mathieu Maret; +Cc: pe1dnn, devel, linux-kernel

On Wed, Mar 19, 2014 at 11:56:14PM +0100, Mathieu Maret wrote:
> Multi statement macro should use do{}while(0)
> 
> patch v2 does not break compilation
> ---
>  drivers/staging/wlags49_h2/wl_netdev.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/wlags49_h2/wl_netdev.c b/drivers/staging/wlags49_h2/wl_netdev.c
> index 255d291..0e553ae 100644
> --- a/drivers/staging/wlags49_h2/wl_netdev.c
> +++ b/drivers/staging/wlags49_h2/wl_netdev.c
> @@ -107,9 +107,11 @@
>   * macros
>   ******************************************************************************/
>  #define BLOCK_INPUT(buf, len) \
> -    desc->buf_addr = buf; \
> -    desc->BUF_SIZE = len; \
> -    status = hcf_rcv_msg(&(lp->hcfCtx), desc, 0)
> +	do { \
> +		desc->buf_addr = buf; \
> +		desc->BUF_SIZE = len; \
> +		status = hcf_rcv_msg(&(lp->hcfCtx), desc, 0); \
> +	} while (0)

This patch is already in my tree :(

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-03-20  1:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-19 22:56 [PATCHv2 4/5] staging: wlags49_h2: Correct macro style in wl_netdev.c Mathieu Maret
2014-03-20  1:53 ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.