Skip to contentSkip to conversation

zonefs: Macros with complex values should be enclosed in parentheses

PATCH Damien Le Moal 1 participant 1 message May 10, 2021 1 message not in the archive VFS

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 3 lines · wjc

Macros with complex values should be enclosed in parentheses

Please use your full name for your Signed-off-by tag.

Quoted 9 lines
---
 fs/zonefs/trace.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/zonefs/trace.h +0 -0
index f369d7d50303..5b0c87d331a1 100644

fs/zonefs/trace.h line 20

Quoted 5 lines
fs/zonefs/trace.h +1 -1
@@ -17,7 +17,7 @@
 
 #include "zonefs.h"
 
-#define show_dev(dev) MAJOR(dev), MINOR(dev)
+#define show_dev(dev) (MAJOR(dev), MINOR(dev))

This macro is used in TP_printk() to specify 2 print arguments. Changing it like you did does not even compile. Seriously, at least please compile test.

If this is from a static code analyzer, then suppressing the warning needs to be done by removing this macro entirely.

Quoted 4 lines
fs/zonefs/trace.h +0 -0
 TRACE_EVENT(zonefs_zone_mgmt,
 	    TP_PROTO(struct inode *inode, enum req_opf op),
 
Signature · 2 lines
Damien Le Moal
Western Digital Research