Skip to contentSkip to conversation

staging: octeon-usb: Add brackets to avoid precedence issues

PATCH In review Nishka Dasgupta 3 participants 3 messages Mar 4, 2019 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: octeon-usb: Add brackets to avoid precedence issues

Add parentheses around macro arguments to avoid precedence issues. Issue found with Checkpatch.

---
 drivers/staging/octeon-usb/octeon-hcd.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/octeon-usb/octeon-hcd.h +2 -2
index ae7ae50071ae..0ee74f63fdbf 100644
@@ -51,10 +51,10 @@
 #include <asm/bitfield.h>
 
 #define CVMX_USBCXBASE 0x00016F0010000000ull
-#define CVMX_USBCXREG1(reg, bid) \
+#define CVMX_USBCXREG1((reg), bid) \
 	(CVMX_ADD_IO_SEG(CVMX_USBCXBASE | reg) + \
 	 ((bid) & 1) * 0x100000000000ull)
-#define CVMX_USBCXREG2(reg, bid, off) \
+#define CVMX_USBCXREG2((reg), bid, off) \
 	(CVMX_ADD_IO_SEG(CVMX_USBCXBASE | reg) + \
 	 (((off) & 7) + ((bid) & 1) * 0x8000000000ull) * 32)
 
Signature · 1 line
2.19.1
maintainer
#1 lore raw
Quoted 13 lines · Nishka Dasgupta

Add parentheses around macro arguments to avoid precedence issues. Issue found with Checkpatch.

---
 drivers/staging/octeon-usb/octeon-hcd.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/octeon-usb/octeon-hcd.h +0 -0
index ae7ae50071ae..0ee74f63fdbf 100644

drivers/staging/octeon-usb/octeon-hcd.h line 54

Quoted 5 lines
drivers/staging/octeon-usb/octeon-hcd.h +1 -1
@@ -51,10 +51,10 @@
 #include <asm/bitfield.h>
 
 #define CVMX_USBCXBASE 0x00016F0010000000ull
-#define CVMX_USBCXREG1(reg, bid) \
+#define CVMX_USBCXREG1((reg), bid) \

I really do not think you changed any "precedence issues" here at all :(

#2 lore raw
Quoted 17 lines · Greg KH
Quoted 15 lines · Nishka Dasgupta

Add parentheses around macro arguments to avoid precedence issues. Issue found with Checkpatch.

---
 drivers/staging/octeon-usb/octeon-hcd.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/octeon-usb/octeon-hcd.h +0 -0
index ae7ae50071ae..0ee74f63fdbf 100644
@@ -51,10 +51,10 @@
 #include <asm/bitfield.h>
 
Quoted 5 lines

drivers/staging/octeon-usb/octeon-hcd.h line 54

Quoted 3 lines
drivers/staging/octeon-usb/octeon-hcd.h +1 -1
 #define CVMX_USBCXBASE 0x00016F0010000000ull
-#define CVMX_USBCXREG1(reg, bid) \
+#define CVMX_USBCXREG1((reg), bid) \

I really do not think you changed any "precedence issues" here at all :(

Sorry about that; I won't submit this kind of patch in future.

- Nishka

Quoted 6 lines

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20190304190311.GE13830%40kroah.com.
For more options, visit https://groups.google.com/d/optout.