lkml.org 
[lkml]   [2014]   [Nov]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: s390/net: Deletion of unnecessary checks before two function calls
On Mon, Nov 03, 2014 at 04:55:12PM +0100, SF Markus Elfring wrote:
> > This one is buggy.
>
> I am still interested to clarify this opinion a bit more.
>

After your patch then it will print warning messages.

The truth is I think that all these patches are bad and they make the
code harder to read.

Before: The code is clear and there is no NULL dereference.
After: You have to remember that rtw_free_netdev() accepts NULL
pointers but free_netdev() does not accept NULL pointers.

The if statements are there for *human* readers to understand and you are
making it harder for humans to understand the code.

Even for kfree(), just removing the if statement is not really the right
fix. We do it because everyone knows kfree(), but what Julia Lawall
said is the real correct way change the code and make it simpler for
people to understand:

https://lkml.org/lkml/2014/10/31/452

I know it's fun to send automated patches but these make the code worse
and they waste reviewer time.

regards,
dan carpenter


\
 
 \ /
  Last update: 2014-11-03 17:41    [W:0.890 / U:0.348 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site