Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752382AbaK3Vgh (ORCPT ); Sun, 30 Nov 2014 16:36:37 -0500 Received: from mout.gmx.net ([212.227.15.18]:60374 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752021AbaK3Vgf (ORCPT ); Sun, 30 Nov 2014 16:36:35 -0500 Message-ID: <547B8DE2.9030301@gmx.de> Date: Sun, 30 Nov 2014 22:36:34 +0100 From: Lino Sanfilippo User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: SF Markus Elfring CC: Julia Lawall , Olof Johansson , netdev@vger.kernel.org, LKML , kernel-janitors@vger.kernel.org Subject: Re: net-PA Semi: Deletion of unnecessary checks before the function call "pci_dev_put" 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> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:qiTbyc1hLth4s+L4zuzEvLrswLxyCRKlTxCyh134rhZ5y4qo+Zy r1MHJ4cB7EmCBRq/ZaZMlGQ6cqVP+i/aCNJkKmY5O83weB9NMP+fvQKUINXbyF4X3kZFD2W jzp52DhZyzey0W0cDuvfeflsN7HxrwWk25gYvqZ9LoGT9ao0KwualXZU32e9NkU0SQcZPm1 KkIv+VQ2n4Iow9YDdQDEw== X-UI-Out-Filterresults: notjunk:1; Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/