Skip to contentSkip to conversation

staging: octeon-usb: fixed precedence issue

PATCH In review Selvakumar Elangovan 2 participants 3 messages Mar 13, 2021 – Mar 14, 2021 1 message not in the archive Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: octeon-usb: fixed precedence issue

Added parenthesis around reg macro to avoid precedence issue identified by checkpatch.pl

---
 drivers/staging/octeon-usb/octeon-hcd.h | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/staging/octeon-usb/octeon-hcd.h +8 -8
index 9ed619c93a4e..5aefd3fb3854 100644
@@ -51,11 +51,11 @@
 #include <asm/bitfield.h>
 
 #define CVMX_USBCXBASE 0x00016F0010000000ull
-#define CVMX_USBCXREG1(reg, bid) \
-	(CVMX_ADD_IO_SEG(CVMX_USBCXBASE | reg) + \
+#define CVMX_USBCXREG1((reg), bid) \
+	(CVMX_ADD_IO_SEG(CVMX_USBCXBASE | (reg)) + \
 	 ((bid) & 1) * 0x100000000000ull)
-#define CVMX_USBCXREG2(reg, bid, off) \
-	(CVMX_ADD_IO_SEG(CVMX_USBCXBASE | reg) + \
+#define CVMX_USBCXREG2((reg), bid, off) \
+	(CVMX_ADD_IO_SEG(CVMX_USBCXBASE | (reg)) + \
 	 (((off) & 7) + ((bid) & 1) * 0x8000000000ull) * 32)
 
 #define CVMX_USBCX_GAHBCFG(bid)		CVMX_USBCXREG1(0x008, bid)
@@ -86,10 +86,10 @@
 #define CVMX_USBNXBID1(bid) (((bid) & 1) * 0x10000000ull)
 #define CVMX_USBNXBID2(bid) (((bid) & 1) * 0x100000000000ull)
 
-#define CVMX_USBNXREG1(reg, bid) \
-	(CVMX_ADD_IO_SEG(0x0001180068000000ull | reg) + CVMX_USBNXBID1(bid))
-#define CVMX_USBNXREG2(reg, bid) \
-	(CVMX_ADD_IO_SEG(0x00016F0000000000ull | reg) + CVMX_USBNXBID2(bid))
+#define CVMX_USBNXREG1((reg), bid) \
+	(CVMX_ADD_IO_SEG(0x0001180068000000ull | (reg)) + CVMX_USBNXBID1(bid))
+#define CVMX_USBNXREG2((reg), bid) \
+	(CVMX_ADD_IO_SEG(0x00016F0000000000ull | (reg)) + CVMX_USBNXBID2(bid))
 
 #define CVMX_USBNX_CLK_CTL(bid)		CVMX_USBNXREG1(0x10, bid)
 #define CVMX_USBNX_DMA0_INB_CHN0(bid)	CVMX_USBNXREG2(0x818, bid)
Signature · 1 line
2.17.1
maintainer
#1 lore raw
Quoted 13 lines · Selvakumar Elangovan

Added parenthesis around reg macro to avoid precedence issue identified by checkpatch.pl

---
 drivers/staging/octeon-usb/octeon-hcd.h | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/staging/octeon-usb/octeon-hcd.h +0 -0
index 9ed619c93a4e..5aefd3fb3854 100644

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

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

Why did you change this line?

maintainer
#3 lore raw
In reply to a message not in the archive

A: http://en.wikipedia.org/wiki/Top_post
Q: Were do I find info about this thing called top-posting?
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

A: No.
Q: Should I include quotations after my reply?

http://daringfireball.net/2007/07/on_top

Quoted 3 lines · Selvakumar E

Hi Greg
I changed the line because of the checkpatch.pl warned for
precedence issue.

But I fail to see how this:

Quoted 1 line
Quoted 1 line
Quoted 1 line

+#define CVMX_USBCXREG1((reg), bid) \

Does anything here at all.

What am I missing?

thanks,

greg k-h