Re: [PATCH] staging: rtl8188eu: core: switch with redundant cases

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

 



On Wed, 04 Feb 2015, Dan Carpenter wrote:

> Btw, what tool are you using to find these?
>
working on a set of coccinell scripts - they are not yet
really clean - but this one is simply:


virtual context
virtual patch
virtual org
virtual report

@assign@
position p;
statement S1;
@@

<+...
* if@p (...) S1 else S1
...+>

@script:python@
p << assign.p;
@@

print "%s:%s WARNING: condition with no effect" % (p[0].file,p[0].line)



I guess this is not wildly impressive - but it seems to be effective
in finding a lot of broken code. The rate of false postivs has been
supprisingly low (very few case of intentional if==else like in
./fs/kernfs/file.c:661 - which is nicely documented)

thx!
hofrat
 
_______________________________________________
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