[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <5486AA1A.4060802@tandemg.com>
Date: Tue, 09 Dec 2014 09:51:54 +0200
From: Asaf Vertz <asaf.vertz@...demg.com>
To: Joe Perches <joe@...ches.com>
CC: dmitry.torokhov@...il.com, LW@...O-electronics.de,
B38611@...escale.com, maksqwe1@....net, jg1.han@...sung.com,
linux@...musvillemoes.dk, fabf@...net.be,
linux-input@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] input: edt-ft5x06: fixed a macro coding style issue
On 12/09/2014 08:44 AM, Joe Perches wrote:
> On Tue, 2014-12-09 at 08:34 +0200, Asaf Vertz wrote:
>> Fixed a coding style error, macros with complex values should be
>> enclosed in parentheses.
>>
>> -#define EDT_ATTR_CHECKSET(name, reg) \
>> +#define EDT_ATTR_CHECKSET(name, reg) { \
>> 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); \
>> +}
>
> Any time you see a naked if (foo) bar in a macro
> prefer to use a do while (0) like;
>
> #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); \
> while (0)
>
thanks for the input, I will update and resend it
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists