From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julia Lawall Date: Mon, 03 Nov 2014 17:02:14 +0000 Subject: Re: s390/net: Deletion of unnecessary checks before two function calls Message-Id: List-Id: References: <530CD2C4.4050903@users.sourceforge.net> <530CF8FF.8080600@users.sourceforge.net> <530DD06F.4090703@users.sourceforge.net> <5317A59D.4@users.sourceforge.net> <5453C98C.90105@users.sourceforge.net> <20141103095059.GL6879@mwanda> <5457A560.2020304@users.sourceforge.net> <20141103162528.GT6890@mwanda> <5457B268.3020202@users.sourceforge.net> In-Reply-To: <5457B268.3020202@users.sourceforge.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: cocci@systeme.lip6.fr > > 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