Re: [PATCH] staging: pi433: pi433_if.c Fix SET_CHECKED style issues

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

 



On Thu, Nov 30, 2017 at 10:40:14PM +0100, Nguyen Phan Quang Minh wrote:
> Fix checkpatch warning and add result holder variable to reduce overhead
> since the macro is called on functions.
> 
> Signed-off-by: Nguyen Phan Quang Minh <minhnpq16@xxxxxxxxx>
> ---
> Since SET_CHECKED has a return statement, I'm very tempted to straight
> up remove it and do the checking inline. But the macro is used a lot
> (~60 times), I think it might hurt the readability of the code.
> 

Yeah.  Last time I saw this I said to kill it with fire but now that
you've fixed the major bug I'm less destructive I guess...

https://lkml.org/lkml/2017/7/28/401

The other typical bug with hidden returns is that we don't unlock or
release resources on error.  There are some of those bugs in the probe
function.

We definitely should get rid of the SET_CHECKED() macro, and if you do
it in a very mechanical no-thinking type of sed way, I won't complain.
But it would be nice to take some time and try to do it nicely.

regards,
dan carpenter

_______________________________________________
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