Re: [PATCH] ks7010: adding parenthesis to macro argument
From: Pushkar Jambhlekar
Date: Tue Mar 14 2017 - 06:01:57 EST
Hi Dan,
I am trying to fix warnings by "checkpatch.pl". Even though it is not
super exciting, no harm to follow correct way.
On Tue, Mar 14, 2017 at 2:43 AM, Dan Carpenter <dan.carpenter@xxxxxxxxxx> wrote:
> On Tue, Mar 14, 2017 at 11:12:42AM +0530, Pushkar Jambhlekar wrote:
>> Description:
>> In driver module ks7010, "checkpatch.pl" flags error for adding parenthesis around macro params.
>> Also, removing extra line.
>
> Don't do this as one patch.
>
>>
>> Signed-off-by: Pushkar Jambhlekar <pushkar.iit@xxxxxxxxx>
>> ---
>> drivers/staging/ks7010/ks7010_sdio.c | 13 ++++++-------
>> 1 file changed, 6 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
>> index a604c83..644b8d4 100644
>> --- a/drivers/staging/ks7010/ks7010_sdio.c
>> +++ b/drivers/staging/ks7010/ks7010_sdio.c
>> @@ -35,18 +35,18 @@ MODULE_DEVICE_TABLE(sdio, ks7010_sdio_ids);
>> /* macro */
>>
>> #define inc_txqhead(priv) \
>> - (priv->tx_dev.qhead = (priv->tx_dev.qhead + 1) % TX_DEVICE_BUFF_SIZE)
>> + ((priv)->tx_dev.qhead = ((priv)->tx_dev.qhead + 1) % TX_DEVICE_BUFF_SIZE)
>
> I can't get excited about this at all. Make it a function or leave it
> alone.
>
> regards,
> dan carpenter
>
--
Jambhlekar Pushkar Arun
M.Tech IIT Roorkee