Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752689AbaLAGws (ORCPT ); Mon, 1 Dec 2014 01:52:48 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:21088 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752247AbaLAGwq (ORCPT ); Mon, 1 Dec 2014 01:52:46 -0500 Date: Mon, 1 Dec 2014 09:52:21 +0300 From: Dan Carpenter To: OGAWA Hirofumi Cc: Julia Lawall , SF Markus Elfring , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, trivial@kernel.org, Coccinelle Subject: Re: [PATCH v2] fs-fat: Less function calls in fat_fill_super() after error detection Message-ID: <20141201065221.GA4994@mwanda> References: <530DD06F.4090703@users.sourceforge.net> <5317A59D.4@users.sourceforge.net> <5467B12C.4010602@users.sourceforge.net> <54796B5E.5040707@users.sourceforge.net> <87sih22sn8.fsf@devron.myhome.or.jp> <87lhmu2jl8.fsf@devron.myhome.or.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87lhmu2jl8.fsf@devron.myhome.or.jp> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: acsinet21.oracle.com [141.146.126.237] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Nov 29, 2014 at 10:59:47PM +0900, OGAWA Hirofumi wrote: > Julia Lawall writes: > > >> iput() checks NULL of inode. What is wrong just remove NULL check, > >> instead of adding new jump labels? > > > > Personally, I prefer that code that can be statically determined not to > > need to be executed not to be executed. It can make the code easier to > > understand, because each function is only called when doing so is useful, > > and it can be helpful to static analysis. > > Hm, first of all, we want to prevent the bugs. More labels are more > chances of bug (and we don't care micro optimize on this error path), > isn't it? Increasing the chance of bugs and bothers developers for > analyzer sounds like strange. Oh wow! Absolutely not. "One Err Bugs" are one of the most common kinds of bugs we have in the kernel. This is where you have just one error label and the bugs look like this: err: kfree(foo->bar); kfree(foo); but foo is NULL. Mixing the error paths together it always creates confusion. I fix so many of these bugs... We get a few new ones every week. Meanwhile Markus's error labels are absolutely useless. They give no indication of what going to the label does. regards, dan carpenter -- 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/