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
> > After your patch then it will print warning messages.
> > After: You have to remember that rtw_free_netdev() accepts NULL
> > pointers but free_netdev() does not accept NULL pointers.
>
> Are any improvements needed for the corresponding documentation to make it
> better accessible besides the source code?

When people are writing or reading code, they will not necessarily look at
the documentation for every function that they use.

> > The if statements are there for *human* readers to understand and you are
> > making it harder for humans to understand the code.
>
> Is there a target conflict between source code understandability
> and software efficiency?

Efficiency is not an issue. This code is all in rare error handling paths
or in service removal functions. None of it is in a critical path. What
is important is to be able to easily check that what needs to be done is
actually done. Removing null tests makes it more obscure what needs to be
done, because it means that the conditions under which a function needs to
be called (which may be different than the conditions under which it can
be called) are less apparent.

julia


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