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


Groups > linux.kernel > #1672336 > unrolled thread

[PATCH] Staging: rtl8712 : osdep_intf.h: fix macro coding style issue

Started byJaya Durga <rjdurga@gmail.com>
First post2017-06-22 08:50 +0200
Last post2017-06-23 22:30 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] Staging: rtl8712 : osdep_intf.h: fix macro coding style issue Jaya Durga <rjdurga@gmail.com> - 2017-06-22 08:50 +0200
    Re: [PATCH] Staging: rtl8712 : osdep_intf.h: fix macro coding style  issue Greg KH <gregkh@linuxfoundation.org> - 2017-06-23 22:30 +0200

#1672336 — [PATCH] Staging: rtl8712 : osdep_intf.h: fix macro coding style issue

FromJaya Durga <rjdurga@gmail.com>
Date2017-06-22 08:50 +0200
Subject[PATCH] Staging: rtl8712 : osdep_intf.h: fix macro coding style issue
Message-ID<tV46d-XH-5@gated-at.bofh.it>
From: Jaya Durga <jayad@cdac.in>

Fix checkpatch.pl warning of the form "CHECK" Macro argument 'x'
may be better as '(x)' to avoid precedence issues.

Signed-off-by: Jaya Durga <jayad@cdac.in>
---
 drivers/staging/rtl8712/osdep_intf.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8712/osdep_intf.h b/drivers/staging/rtl8712/osdep_intf.h
index 5d37e1f..1985423 100644
--- a/drivers/staging/rtl8712/osdep_intf.h
+++ b/drivers/staging/rtl8712/osdep_intf.h
@@ -29,7 +29,7 @@
 #include "osdep_service.h"
 #include "drv_types.h"

-#define RND4(x)	(((x >> 2) + (((x & 3) == 0) ?  0 : 1)) << 2)
+#define RND4(x)	((((x) >> 2) + ((((x) & 3) == 0) ?  0 : 1)) << 2)

 struct intf_priv {
	u8 *intf_dev;
--
1.9.1

[toc] | [next] | [standalone]


#1673841 — Re: [PATCH] Staging: rtl8712 : osdep_intf.h: fix macro coding style issue

FromGreg KH <gregkh@linuxfoundation.org>
Date2017-06-23 22:30 +0200
SubjectRe: [PATCH] Staging: rtl8712 : osdep_intf.h: fix macro coding style issue
Message-ID<tVDnl-6P1-47@gated-at.bofh.it>
In reply to#1672336
On Thu, Jun 22, 2017 at 12:10:04PM +0530, Jaya Durga wrote:
> From: Jaya Durga <jayad@cdac.in>
> 
> Fix checkpatch.pl warning of the form "CHECK" Macro argument 'x'
> may be better as '(x)' to avoid precedence issues.
> 
> Signed-off-by: Jaya Durga <jayad@cdac.in>
> ---
>  drivers/staging/rtl8712/osdep_intf.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/rtl8712/osdep_intf.h b/drivers/staging/rtl8712/osdep_intf.h
> index 5d37e1f..1985423 100644
> --- a/drivers/staging/rtl8712/osdep_intf.h
> +++ b/drivers/staging/rtl8712/osdep_intf.h
> @@ -29,7 +29,7 @@
>  #include "osdep_service.h"
>  #include "drv_types.h"
> 
> -#define RND4(x)	(((x >> 2) + (((x & 3) == 0) ?  0 : 1)) << 2)
> +#define RND4(x)	((((x) >> 2) + ((((x) & 3) == 0) ?  0 : 1)) << 2)

Why not move this to use the in-kernel macros instead?

thanks,

greg k-h

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web