[Cocci] Remove unnecessary null pointer checks?

SF Markus Elfring elfring at users.sourceforge.net
Fri Feb 21 22:52:34 CET 2014


Hello,

I have tried the following short semantic patch out on a source file directory
for Linux 3.13.1.

@Remove_unnecessary_pointer_checks@
expression x;
@@
-if (x)
    kfree(x);


Some update candidates were found. I imagine that this search pattern can be
extended a bit more.
How do think about the applicability of corresponding changes for current kernel
source code?
What will be a good way to discuss such fixes on other mailing lists eventually?

Regards,
Markus


More information about the Cocci mailing list