From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753729AbbGEIaL (ORCPT ); Sun, 5 Jul 2015 04:30:11 -0400 Received: from mout.web.de ([212.227.15.3]:53511 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753458AbbGEI36 (ORCPT ); Sun, 5 Jul 2015 04:29:58 -0400 Message-ID: <5597B641.2030704@users.sourceforge.net> Date: Sat, 04 Jul 2015 12:32:33 +0200 From: SF Markus Elfring User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Anton Altaparmakov , linux-ntfs-dev@lists.sourceforge.net CC: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Julia Lawall Subject: Re: [PATCH] ntfs: Deletion of unnecessary checks before the function call "iput" 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> <54679E97.5000801@users.sourceforge.net> In-Reply-To: <54679E97.5000801@users.sourceforge.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:nv0SEWfNovx+FB1xW0PRvnJWQvpG9jSkE2Pkbp92Mk18CFJ6Zeh SeVPlbAjkZGndkNAoJW7J8Xf0bs0n69zv2wz5t+WjIYCw7IHKA1jegRaliSOdnOzGliVCsk ZMV1Ljg+NNd3/KZyoDFm7rlq+4bNRnJkBcrwteKzo/9xQqnttj4YHSmd8eapMNIjMso8qqx N0gg6R3qWcV/cJKbVZdoA== X-UI-Out-Filterresults: notjunk:1;V01:K0:dQOWO8YY34E=:EZ1FNTvW3uiqf2a5cR8s0b GqtU7gJz1k7YZpoVfq8U6Z7e1l97exw7Of9YRpVuo5KO2PrfDBKrRqbrNUhmRHoDOZDf8v8Ad 8XfBBzAB+ZmexXRPV2ogHmbF/iycv0OqtWdX0CaHPWCcvjPKDk7fi1Q5ek2mzfiWZFPZmAYcp ifkSICOZxEqOQi+sd7Hxxew5PFvAkUAMhngTY1TvqA+3/K0Cw1CKLvlcek7C/MEplHaILu3Ag MpvhKGnCfAnAOYZfpMtlCLffq0hmDQl08mw7I2Kb12J0PHtKPTxH1W+dxZAnATQRetee244am 4aDu88LjMhv78L2cRIKIu284zVFIhQTyZCpH2d9JFa6Ejy24a1V+GqwoENF/ZfnX118WYf23d qFlRLNSX7I/epDcxQ2FASWcYTuY7JI1SaMIutpMiu5mXwxE4zbS9aes9K20lLbUxMkL/aXc/U cK09PlegWLWrjfYB0R1wa/fXx71AMrMyv17Dbs046RH9G3YGVS5iyf6GtIF0kmejWnTOeE2CT T/c2sm2rJmQxg/v4/CmAHfvT5Nav7up6swpjgIjekowHCAu5jNaw6A7Imv46QNxK00JIgw3BQ +THo/+1xLECsVbjSSUs6B0gA1t0MUdFozR7RJ2qESxzOoyVlDMGAzh0PTmzgGlJVgeDBKRloo 4Y3IQ5VvEiyZT5/64mSAQ9EeHyWyvJ+VjKz40XW0pQfu5GwUqdp8lLMxQJkQMO+o1ttU= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > From: Markus Elfring > Date: Sat, 15 Nov 2014 19:35:05 +0100 > > The iput() function tests whether its argument is NULL and then > returns immediately. Thus the test around the call is not needed. > > This issue was detected by using the Coccinelle software. > > Signed-off-by: Markus Elfring > --- > fs/ntfs/super.c | 21 +++++++-------------- > 1 file changed, 7 insertions(+), 14 deletions(-) > > diff --git a/fs/ntfs/super.c b/fs/ntfs/super.c > index 6c3296e..8f22a47 100644 > --- a/fs/ntfs/super.c > +++ b/fs/ntfs/super.c > @@ -2204,17 +2204,12 @@ get_ctx_vol_failed: > return true; > #ifdef NTFS_RW > iput_usnjrnl_err_out: > - if (vol->usnjrnl_j_ino) > - iput(vol->usnjrnl_j_ino); > - if (vol->usnjrnl_max_ino) > - iput(vol->usnjrnl_max_ino); > - if (vol->usnjrnl_ino) > - iput(vol->usnjrnl_ino); > + iput(vol->usnjrnl_j_ino); > + iput(vol->usnjrnl_max_ino); > + iput(vol->usnjrnl_ino); > iput_quota_err_out: > - if (vol->quota_q_ino) > - iput(vol->quota_q_ino); > - if (vol->quota_ino) > - iput(vol->quota_ino); > + iput(vol->quota_q_ino); > + iput(vol->quota_ino); > iput(vol->extend_ino); > #endif /* NTFS_RW */ > iput_sec_err_out: > @@ -2223,8 +2218,7 @@ iput_root_err_out: > iput(vol->root_ino); > iput_logfile_err_out: > #ifdef NTFS_RW > - if (vol->logfile_ino) > - iput(vol->logfile_ino); > + iput(vol->logfile_ino); > iput_vol_err_out: > #endif /* NTFS_RW */ > iput(vol->vol_ino); > @@ -2254,8 +2248,7 @@ iput_mftbmp_err_out: > iput(vol->mftbmp_ino); > iput_mirr_err_out: > #ifdef NTFS_RW > - if (vol->mftmirr_ino) > - iput(vol->mftmirr_ino); > + iput(vol->mftmirr_ino); > #endif /* NTFS_RW */ > return false; > } > Would you like to integrate this update suggestion into another source code repository? Regards, Markus