Skip to contentSkip to conversation

staging: fbtft: Remove do {} while(0) in single statement macro

PATCH New Helen Fornazier 1 participant 1 message Mar 25, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: fbtft: Remove do {} while(0) in single statement macro

This patch fixes the checkpatch.pl warning:

WARNING: Single statement macros should not use a do {} while (0) loop
+#define write_reg(par, ...) \
+do { \
+ par->fbtftops.write_register(par, NUMARGS(__VA_ARGS__), __VA_ARGS__); \
+} while (0)

---
 drivers/staging/fbtft/fbtft.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/fbtft/fbtft.h +1 -3
index 36ecf02..f55cc5b 100644
@@ -259,9 +259,7 @@ struct fbtft_par {
 #define NUMARGS(...)  (sizeof((int[]){__VA_ARGS__})/sizeof(int))
 
 #define write_reg(par, ...)                                              \
-do {                                                                     \
-	par->fbtftops.write_register(par, NUMARGS(__VA_ARGS__), __VA_ARGS__); \
-} while (0)
+	par->fbtftops.write_register(par, NUMARGS(__VA_ARGS__), __VA_ARGS__)
 
 /* fbtft-core.c */
 extern void fbtft_dbg_hex(const struct device *dev,
Signature · 1 line
1.9.1