Skip to contentSkip to conversation

staging: fwserial: Add Brackets around Parameters

PATCH In review Nishka Dasgupta 2 participants 2 messages Mar 4, 2019 – Mar 5, 2019 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: fwserial: Add Brackets around Parameters

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

---
 drivers/staging/fwserial/fwserial.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/fwserial/fwserial.c +1 -1
index a1b90ea7fcb8..120d91dd6c8c 100644
@@ -89,7 +89,7 @@ struct fwtty_transaction {
 	};
 };
 
-#define to_device(a, b)			(a->b)
+#define to_device((a), (b))			(a->b)
 #define fwtty_err(p, fmt, ...)						\
 	dev_err(to_device(p, device), fmt, ##__VA_ARGS__)
 #define fwtty_info(p, fmt, ...)						\
Signature · 1 line
2.19.1
maintainer
#1 lore raw
Quoted 13 lines · Nishka Dasgupta

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

---
 drivers/staging/fwserial/fwserial.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/fwserial/fwserial.c +0 -0
index a1b90ea7fcb8..120d91dd6c8c 100644

drivers/staging/fwserial/fwserial.c struct fwtty_transaction { · line 92

Quoted 5 lines
drivers/staging/fwserial/fwserial.c +1 -1
@@ -89,7 +89,7 @@ struct fwtty_transaction {
 	};
 };
 
-#define to_device(a, b)			(a->b)
+#define to_device((a), (b))			(a->b)

Also not needed :(