From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751298AbaK2N7w (ORCPT ); Sat, 29 Nov 2014 08:59:52 -0500 Received: from mail.parknet.co.jp ([210.171.160.6]:55358 "EHLO mail.parknet.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751199AbaK2N7v (ORCPT ); Sat, 29 Nov 2014 08:59:51 -0500 From: OGAWA Hirofumi To: Julia Lawall Cc: 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 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> <5467B12C.4010602@users.sourceforge.net> <54796B5E.5040707@users.sourceforge.net> <87sih22sn8.fsf@devron.myhome.or.jp> Date: Sat, 29 Nov 2014 22:59:47 +0900 In-Reply-To: (Julia Lawall's message of "Sat, 29 Nov 2014 13:40:34 +0100 (CET)") Message-ID: <87lhmu2jl8.fsf@devron.myhome.or.jp> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. (And we are initializing those for avoiding to be bothered by choosing correct label. If we really care micro optimize, initialization of those should not be required and should not be touched on other paths, and gcc can warn its usage.) Thanks. -- OGAWA Hirofumi From mboxrd@z Thu Jan 1 00:00:00 1970 From: OGAWA Hirofumi Date: Sat, 29 Nov 2014 13:59:47 +0000 Subject: Re: [PATCH v2] fs-fat: Less function calls in fat_fill_super() after error detection Message-Id: <87lhmu2jl8.fsf@devron.myhome.or.jp> 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> <5467B12C.4010602@users.sourceforge.net> <54796B5E.5040707@users.sourceforge.net> <87sih22sn8.fsf@devron.myhome.or.jp> In-Reply-To: (Julia Lawall's message of "Sat, 29 Nov 2014 13:40:34 +0100 (CET)") MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Julia Lawall Cc: SF Markus Elfring , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, trivial@kernel.org, Coccinelle 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. (And we are initializing those for avoiding to be bothered by choosing correct label. If we really care micro optimize, initialization of those should not be required and should not be touched on other paths, and gcc can warn its usage.) Thanks. -- OGAWA Hirofumi