mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Markus Elfring <Markus.Elfring@web.de>
Cc: Jan Kara <jack@suse.com>,
	kernel-janitors@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] fs-udf: Delete an unnecessary check before brelse()
Date: Wed, 4 Sep 2019 09:48:30 +0200	[thread overview]
Message-ID: <20190904074830.GD8225@quack2.suse.cz> (raw)
In-Reply-To: <a254c1d1-0109-ab51-c67a-edc5c1c4b4cd@web.de>

On Tue 03-09-19 21:15:58, Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Tue, 3 Sep 2019 21:12:09 +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 for the patch. Added to my tree.

								Honza

> ---
>  fs/udf/super.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/fs/udf/super.c b/fs/udf/super.c
> index 56da1e1680ea..0cd0be642a2f 100644
> --- a/fs/udf/super.c
> +++ b/fs/udf/super.c
> @@ -273,8 +273,7 @@ static void udf_sb_free_bitmap(struct udf_bitmap *bitmap)
>  	int nr_groups = bitmap->s_nr_groups;
> 
>  	for (i = 0; i < nr_groups; i++)
> -		if (bitmap->s_block_bitmap[i])
> -			brelse(bitmap->s_block_bitmap[i]);
> +		brelse(bitmap->s_block_bitmap[i]);
> 
>  	kvfree(bitmap);
>  }
> --
> 2.23.0
> 
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

      reply	other threads:[~2019-09-04  7:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-03 19:15 Markus Elfring
2019-09-04  7:48 ` 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=20190904074830.GD8225@quack2.suse.cz \
    --to=jack@suse.cz \
    --cc=Markus.Elfring@web.de \
    --cc=jack@suse.com \
    --cc=kernel-janitors@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

all inboxes | Powered by JetHome®