Skip to contentSkip to conversation

Staging: line6: fix parentheses around macro in usbdefs.h

PATCH In review Sam van Kampen 3 participants 3 messages Dec 3, 2014 – Jan 12, 2015 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: line6: fix parentheses around macro in usbdefs.h

This patch fixes the error "Macros with complex values should be enclosed in parentheses", as reported by checkpatch.pl.

---
 drivers/staging/line6/usbdefs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/line6/usbdefs.h +1 -1
index 2d1cc47..48958b5 100644
@@ -40,7 +40,7 @@
 #define LINE6_DEVID_TONEPORT_UX2  0x4142
 #define LINE6_DEVID_VARIAX        0x534d
 
-#define LINE6_BIT(x) LINE6_BIT_ ## x = 1 << LINE6_INDEX_ ## x
+#define LINE6_BIT(x) (LINE6_BIT_ ## x = 1 << LINE6_INDEX_ ## x)
 
 enum {
 	LINE6_INDEX_BASSPODXT,
Signature · 1 line
2.0.4
#1 lore raw
Quoted 2 lines · Sam van Kampen

This patch fixes the error "Macros with complex values should be enclosed in parentheses", as reported by checkpatch.pl.

[]

drivers/staging/line6/usbdefs.h

Quoted 1 line
drivers/staging/line6/usbdefs.h +0 -0

[]

drivers/staging/line6/usbdefs.h line 43

Quoted 6 lines
drivers/staging/line6/usbdefs.h +1 -1
@@ -40,7 +40,7 @@
 #define LINE6_DEVID_TONEPORT_UX2  0x4142
 #define LINE6_DEVID_VARIAX        0x534d
 
-#define LINE6_BIT(x) LINE6_BIT_ ## x = 1 << LINE6_INDEX_ ## x
+#define LINE6_BIT(x) (LINE6_BIT_ ## x = 1 << LINE6_INDEX_ ## x)

The uses are pretty ugly.

It'd probably be nicer if all the LINE6_BIT uses were direct enum declarations instead.

#2 lore raw
In reply to Sam van Kampen
Quoted 13 lines · Sam van Kampen

This patch fixes the error "Macros with complex values should be enclosed in parentheses", as reported by checkpatch.pl.

---
 drivers/staging/line6/usbdefs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/line6/usbdefs.h +0 -0
index 2d1cc47..48958b5 100644

drivers/staging/line6/usbdefs.h line 46

Quoted 8 lines
drivers/staging/line6/usbdefs.h +1 -1
@@ -40,7 +40,7 @@
 #define LINE6_DEVID_TONEPORT_UX2  0x4142
 #define LINE6_DEVID_VARIAX        0x534d
 
-#define LINE6_BIT(x) LINE6_BIT_ ## x = 1 << LINE6_INDEX_ ## x
+#define LINE6_BIT(x) (LINE6_BIT_ ## x = 1 << LINE6_INDEX_ ## x)
 
 enum {
 	LINE6_INDEX_BASSPODXT,

I love this line in the driver, it proves that people make changes to the code without even building it.

Please ALWAYS test-build your patches, otherwise you waste people's time and make them grumpy.

greg k-h