From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lino Sanfilippo Date: Sun, 30 Nov 2014 21:36:34 +0000 Subject: Re: net-PA Semi: Deletion of unnecessary checks before the function call "pci_dev_put" Message-Id: <547B8DE2.9030301@gmx.de> List-Id: References: <5307CAA2.8060406@users.sourceforge.net> <530A086E.8010901@users.sourceforge.net> <530A72AA.3000601@users.sourceforge.net> <530B5FB6.6010207@users.sourceforge.net> <530C5E18.1020800@users.sourceforge.net> <530CD2C4.4050903@users.sourceforge.net> <530CF8FF.8080600@users.sourceforge.net> <530DD06F.4090703@users.sourceforge.net> <5317A59D.4@users.sourceforge.net> <547A09B1.9090102@users.sourceforge.net> <547B579F.10709@gmx.de> <547B6F9A.8030806@gmx.de> <547B80B7.5030707@users.sourceforge.net> In-Reply-To: <547B80B7.5030707@users.sourceforge.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: SF Markus Elfring Cc: Julia Lawall , Olof Johansson , netdev@vger.kernel.org, LKML , kernel-janitors@vger.kernel.org On 30.11.2014 21:40, SF Markus Elfring wrote: >> Maybe this topic should be clarified somewhere (e.g. in "CodingStyle")? >> On the other hand i always found it obvious that its the callers >> responsibility to only pass sane parameters to the called functions... > > Can you imagine that any more source code places which would benefit from > check adjustments because of defensive programming? > I am not sure if i understand your question correctly. But i would not call sanity checks for function parameters "defensive programming". I would rather call it not being totally careless. So to me the question if those checks should be done or not is different from the question whether there are code parts that would benefit from an adjustment to defensive programming. Regards, Lino