[Patch v4 1/2] staging/lustre: add parenthesis to macro argument

Rishiraj Manwatkar manwatkar at outlook.com
Wed Apr 19 15:50:05 UTC 2017


Add parenthesis to cl_io_for_each() macro to avoid potential issues with
unexpected argument expansion in CPP.

Signed-off-by: Rishiraj Manwatkar <manwatkar at outlook.com>
---
 v1 -> v2: Added mailing list in cc.
 v2 -> v3: Changed From: to be same as Signed-off-by:.
 v3 -> v4: Changed Subject line and patch description as suggested by andreas.dilger at intel.com
 drivers/staging/lustre/lustre/obdclass/cl_io.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/cl_io.c b/drivers/staging/lustre/lustre/obdclass/cl_io.c
index ee7d677..0997254 100755
--- a/drivers/staging/lustre/lustre/obdclass/cl_io.c
+++ b/drivers/staging/lustre/lustre/obdclass/cl_io.c
@@ -52,9 +52,9 @@
  */
 
 #define cl_io_for_each(slice, io) \
-	list_for_each_entry((slice), &io->ci_layers, cis_linkage)
+	list_for_each_entry((slice), &(io)->ci_layers, cis_linkage)
 #define cl_io_for_each_reverse(slice, io)		 \
-	list_for_each_entry_reverse((slice), &io->ci_layers, cis_linkage)
+	list_for_each_entry_reverse((slice), &(io)->ci_layers, cis_linkage)
 
 static inline int cl_io_type_is_valid(enum cl_io_type type)
 {
-- 
2.1.4



More information about the devel mailing list