Dan
The truth is I think that all these patches are bad and they make the code harder to read.
I disagree, I think the code requires less effort to read without the if test. A developer reading the code will wonder why kfree does not handle the case when its argument is NULL. This takes effort. Now there might be a reason while kfree (or any other function) does not handle NULL, in which case the test is necessary for that reason. Or perhaps calling kfree has other consequences and this means it is good to minimise the number of calls, fair enough.
The if statements are there for *human* readers to understand and you are making it harder for humans to understand the code.
The reverse is true. But if there are other reasons, then leave the test in. -- Derek M. Jones tel: +44 (0) 1252 520 667 Knowledge Software Ltd blog:shape-of-code.coding-guidelines.com Software analysis http://www.knosof.co.uk _______________________________________________ Cocci mailing list [email protected] https://systeme.lip6.fr/mailman/listinfo/cocci
