From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753725AbaKLVkn (ORCPT ); Wed, 12 Nov 2014 16:40:43 -0500 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:2336 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753670AbaKLVkk (ORCPT ); Wed, 12 Nov 2014 16:40:40 -0500 X-IronPort-AV: E=Sophos;i="5.07,371,1413237600"; d="scan'208";a="106413368" Date: Wed, 12 Nov 2014 22:40:34 +0100 (CET) From: Julia Lawall X-X-Sender: jll@localhost6.localdomain6 To: SF Markus Elfring cc: Dan Carpenter , Greg Kroah-Hartman , devel@driverdev.osuosl.org, trivial@kernel.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, Coccinelle Subject: Re: [PATCH v2 1/2] staging: rtl8188eu: Deletion of unnecessary checks before three function calls In-Reply-To: <5463D109.4020702@users.sourceforge.net> Message-ID: References: <530DD06F.4090703@users.sourceforge.net> <5317A59D.4@users.sourceforge.net> <544954FD.8040607@users.sourceforge.net> <20141029084702.GA18675@kroah.com> <5453CD0D.9010206@users.sourceforge.net> <5463C10D.6020409@users.sourceforge.net> <5463C22B.7060405@users.sourceforge.net> <20141112211815.GJ6749@mwanda> <5463D109.4020702@users.sourceforge.net> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > This is especially true if you have trained yourself to know that > > free_netdev() can't accept NULL pointers. > > Do you need to adjust your concerns a bit over time when function variants > provide a corresponding safety check in their implementations? There would not seem to be any _need_ to do so. An unnecessary null test is always safe. The only real problem that I can see with an unnecessary null test in error handling code (intrinsically not critical performance wise) is if it gives the illusion that a value can be null when it cannot. julia From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julia Lawall Date: Wed, 12 Nov 2014 21:40:34 +0000 Subject: Re: [PATCH v2 1/2] staging: rtl8188eu: Deletion of unnecessary checks before three function calls Message-Id: List-Id: References: <530DD06F.4090703@users.sourceforge.net> <5317A59D.4@users.sourceforge.net> <544954FD.8040607@users.sourceforge.net> <20141029084702.GA18675@kroah.com> <5453CD0D.9010206@users.sourceforge.net> <5463C10D.6020409@users.sourceforge.net> <5463C22B.7060405@users.sourceforge.net> <20141112211815.GJ6749@mwanda> <5463D109.4020702@users.sourceforge.net> In-Reply-To: <5463D109.4020702@users.sourceforge.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: cocci@systeme.lip6.fr > > This is especially true if you have trained yourself to know that > > free_netdev() can't accept NULL pointers. > > Do you need to adjust your concerns a bit over time when function variants > provide a corresponding safety check in their implementations? There would not seem to be any _need_ to do so. An unnecessary null test is always safe. The only real problem that I can see with an unnecessary null test in error handling code (intrinsically not critical performance wise) is if it gives the illusion that a value can be null when it cannot. julia From mboxrd@z Thu Jan 1 00:00:00 1970 From: julia.lawall@lip6.fr (Julia Lawall) Date: Wed, 12 Nov 2014 22:40:34 +0100 (CET) Subject: [Cocci] [PATCH v2 1/2] staging: rtl8188eu: Deletion of unnecessary checks before three function calls In-Reply-To: <5463D109.4020702@users.sourceforge.net> References: <530DD06F.4090703@users.sourceforge.net> <5317A59D.4@users.sourceforge.net> <544954FD.8040607@users.sourceforge.net> <20141029084702.GA18675@kroah.com> <5453CD0D.9010206@users.sourceforge.net> <5463C10D.6020409@users.sourceforge.net> <5463C22B.7060405@users.sourceforge.net> <20141112211815.GJ6749@mwanda> <5463D109.4020702@users.sourceforge.net> Message-ID: To: cocci@systeme.lip6.fr List-Id: cocci@systeme.lip6.fr > > This is especially true if you have trained yourself to know that > > free_netdev() can't accept NULL pointers. > > Do you need to adjust your concerns a bit over time when function variants > provide a corresponding safety check in their implementations? There would not seem to be any _need_ to do so. An unnecessary null test is always safe. The only real problem that I can see with an unnecessary null test in error handling code (intrinsically not critical performance wise) is if it gives the illusion that a value can be null when it cannot. julia