Skip to contentSkip to conversation

input: edt-ft5x06: fixed a macro coding style issue

PATCH Applied Asaf Vertz 2 participants 2 messages Dec 9, 2014 – Dec 13, 2014

Subsystems (2)
lore
Share & tools
lore

Asaf Vertz

author
#0 lore raw

PATCH v2 1/1 input: edt-ft5x06: fixed a macro coding style issue

Fixed a coding style error, macros with complex values should be enclosed in parentheses.

---
Changes in v2:
- use do {...} while (0) instead of {...}

 drivers/input/touchscreen/edt-ft5x06.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/input/touchscreen/edt-ft5x06.c +3 -1
index ee3434f..d22ed56 100644
@@ -850,9 +850,11 @@ static int edt_ft5x06_ts_identify(struct i2c_client *client,
 }
 
 #define EDT_ATTR_CHECKSET(name, reg) \
+do {								\
 	if (pdata->name >= edt_ft5x06_attr_##name.limit_low &&		\
 	    pdata->name <= edt_ft5x06_attr_##name.limit_high)		\
-		edt_ft5x06_register_write(tsdata, reg, pdata->name)
+		edt_ft5x06_register_write(tsdata, reg, pdata->name);	\
+} while (0)
 
 #define EDT_GET_PROP(name, reg) {				\
 	u32 val;						\
Signature · 1 line
1.7.0.4
maintainer Applied
#1 lore raw
Quoted 4 lines · Asaf Vertz

Fixed a coding style error, macros with complex values should be enclosed in parentheses.

Applied, thank you.

Quoted 27 lines

---
Changes in v2:
- use do {...} while (0) instead of {...}

 drivers/input/touchscreen/edt-ft5x06.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/input/touchscreen/edt-ft5x06.c +3 -1
index ee3434f..d22ed56 100644
@@ -850,9 +850,11 @@ static int edt_ft5x06_ts_identify(struct i2c_client *client,
 }
 
 #define EDT_ATTR_CHECKSET(name, reg) \
+do {								\
 	if (pdata->name >= edt_ft5x06_attr_##name.limit_low &&		\
 	    pdata->name <= edt_ft5x06_attr_##name.limit_high)		\
-		edt_ft5x06_register_write(tsdata, reg, pdata->name)
+		edt_ft5x06_register_write(tsdata, reg, pdata->name);	\
+} while (0)
 
 #define EDT_GET_PROP(name, reg) {				\
 	u32 val;						\
Signature · 1 line
1.7.0.4
Signature · 1 line
Dmitry