From: Jan Kara <jack@suse.cz>
To: Markus Elfring <Markus.Elfring@web.de>
Cc: Jan Kara <jack@suse.com>,
linux-ext4@vger.kernel.org, kernel-janitors@vger.kernel.org,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ext2: Delete an unnecessary check before brelse()
Date: Wed, 4 Sep 2019 09:23:33 +0200 [thread overview]
Message-ID: <20190904072333.GB8225@quack2.suse.cz> (raw)
In-Reply-To: <51dea296-2207-ebc0-bac3-13f3e5c3b235@web.de>
On Tue 03-09-19 14:44:08, Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Tue, 3 Sep 2019 14:40:18 +0200
>
> The brelse() 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 <elfring@users.sourceforge.net>
Thanks. Added to my tree.
Honza
> ---
> fs/ext2/super.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/fs/ext2/super.c b/fs/ext2/super.c
> index baa36c6fb71e..30c630d73f0f 100644
> --- a/fs/ext2/super.c
> +++ b/fs/ext2/super.c
> @@ -162,8 +162,7 @@ static void ext2_put_super (struct super_block * sb)
> }
> db_count = sbi->s_gdb_count;
> for (i = 0; i < db_count; i++)
> - if (sbi->s_group_desc[i])
> - brelse (sbi->s_group_desc[i]);
> + brelse(sbi->s_group_desc[i]);
> kfree(sbi->s_group_desc);
> kfree(sbi->s_debts);
> percpu_counter_destroy(&sbi->s_freeblocks_counter);
> --
> 2.23.0
>
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
prev parent reply other threads:[~2019-09-04 7:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-03 12:44 [PATCH] ext2: Delete an unnecessary check before brelse() Markus Elfring
2019-09-04 7:23 ` Jan Kara [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190904072333.GB8225@quack2.suse.cz \
--to=jack@suse.cz \
--cc=Markus.Elfring@web.de \
--cc=jack@suse.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).