diff mbox

[v2] input: edt-ft5x06: fixed a macro coding style issue

Message ID 20141209080816.GA19581@ubuntu (mailing list archive)
State New, archived
Headers show

Commit Message

Asaf Vertz Dec. 9, 2014, 8:08 a.m. UTC
Fixed a coding style error, macros with complex values should be
enclosed in parentheses.

Signed-off-by: Asaf Vertz <asaf.vertz@tandemg.com>
---
Changes in v2:
  - use do {...} while (0)  instead of {...}

 drivers/input/touchscreen/edt-ft5x06.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

Comments

Dmitry Torokhov Dec. 13, 2014, 6:59 p.m. UTC | #1
On Tue, Dec 09, 2014 at 10:08:16AM +0200, Asaf Vertz wrote:
> Fixed a coding style error, macros with complex values should be
> enclosed in parentheses.
> 
> Signed-off-by: Asaf Vertz <asaf.vertz@tandemg.com>

Applied, thank you.

> ---
> Changes in v2:
>   - use do {...} while (0)  instead of {...}
> 
>  drivers/input/touchscreen/edt-ft5x06.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c
> index ee3434f..d22ed56 100644
> --- a/drivers/input/touchscreen/edt-ft5x06.c
> +++ b/drivers/input/touchscreen/edt-ft5x06.c
> @@ -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;						\
> -- 
> 1.7.0.4
>
diff mbox

Patch

diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c
index ee3434f..d22ed56 100644
--- a/drivers/input/touchscreen/edt-ft5x06.c
+++ b/drivers/input/touchscreen/edt-ft5x06.c
@@ -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;						\