Re: [PATCH 2/6] staging: ks7010: fix coding style issue of enclosing complex macro value in parentheses

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Matthew,

> Is this fix really necessary?
This way of fixing is seen across multiple places in the kernel, so it
seems standard way of handling these kind of errors from checkpatch.

> On that note though, if it is going to be added I think it would make
> sense to get the indentation correct with the `do {`:
Sure, I will update and resend v2 version of all the patches.

thanks,
chetan

On 2017年02月17日 13:36, Matthew Kilgore wrote:
> Hi Chetan,
> 
> On Fri, Feb 17, 2017 at 12:08:02PM +0900, Chetan Sethi wrote:
>> +                do {if (KS_WLAN_DEBUG > (n)) \
>> +            printk(KERN_NOTICE "%s: "fmt, __FUNCTION__, ## args); \
>> +        } while (0)
> 
> Is this fix really necessary? I know checkpatch is complaining, but this
> isn't a macro that requires the do { } while (0) fix to ensure it is
> used correctly, it seems kinda superfluous to add it anyway. Checkpatch
> doesn't emit this error for a single statement `for`, so it seems like a
> single statement `if` was also probably not intended to be considered
> 'complex'.
> 
> On that note though, if it is going to be added I think it would make
> sense to get the indentation correct with the `do {`:
> 
>     do { \
>         if (KS_WLAN_DEBUG > (n)) \
>             prink(...); \
>     } while (0)
> 
> Thanks,
> Matthew Kilgore

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux