Skip to contentSkip to conversation

Staging: rtl8712 : osdep_intf.h: fix macro coding style issue

PATCH In review Jaya Durga 2 participants 2 messages Jun 22, 2017 – Jun 23, 2017 Staging

lore
Share & tools
lore

Jaya Durga

author
#0 lore raw

PATCH 1/1 Staging: rtl8712 : osdep_intf.h: fix macro coding style issue

From: Jaya Durga <[email protected]>

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

---
 drivers/staging/rtl8712/osdep_intf.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8712/osdep_intf.h +1 -1
index 5d37e1f..1985423 100644
@@ -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

maintainer
#1 lore raw
Quoted 15 lines · Jaya Durga

From: Jaya Durga <[email protected]>

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

---
 drivers/staging/rtl8712/osdep_intf.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8712/osdep_intf.h +0 -0
index 5d37e1f..1985423 100644

drivers/staging/rtl8712/osdep_intf.h line 32

Quoted 5 lines
drivers/staging/rtl8712/osdep_intf.h +1 -1
@@ -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