Re: [PATCH v3] Staging: wlan-ng: hfa384x_usb: fixed an 'else' statement coding style issue

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

 



On Fri, Dec 19, 2014 at 12:18:26AM -0200, Eduardo Barretto wrote:
> Checkpatch was complaining about the else statement because the if statement had a return '1' call. Taking a look at the function which this else statement belongs, you can see that it has an switch case statement.
> The main idea of the function is to return '1' if you get into any of the cases (including the default case where the "problematic" if/else statement is declared).
> If any of the cases is not sufficient the function should return '0', so the else statement that checkpath was complaining could be removed, and what was done inside this else statement can be done outside the switch case statement and then we return '0'.
> This way we have a cleaner code and no checkpatch error complaints.

Verbose is good, but please wrap your lines at 72 columns.  And this
might have been a bit too verbose :)

thanks,

greg k-h
_______________________________________________
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