All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: kernel-janitors@vger.kernel.org, Jan Kara <jack@suse.com>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] fs-udf: Delete an unnecessary check before brelse()
Date: Tue, 3 Sep 2019 21:15:58 +0200	[thread overview]
Message-ID: <a254c1d1-0109-ab51-c67a-edc5c1c4b4cd@web.de> (raw)

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>
---
 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


WARNING: multiple messages have this Message-ID (diff)
From: Markus Elfring <Markus.Elfring@web.de>
To: kernel-janitors@vger.kernel.org, Jan Kara <jack@suse.com>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] fs-udf: Delete an unnecessary check before brelse()
Date: Tue, 03 Sep 2019 19:15:58 +0000	[thread overview]
Message-ID: <a254c1d1-0109-ab51-c67a-edc5c1c4b4cd@web.de> (raw)

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>
---
 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

             reply	other threads:[~2019-09-03 19:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-03 19:15 Markus Elfring [this message]
2019-09-03 19:15 ` [PATCH] fs-udf: Delete an unnecessary check before brelse() Markus Elfring
2019-09-04  7:48 ` Jan Kara
2019-09-04  7:48   ` Jan Kara

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=a254c1d1-0109-ab51-c67a-edc5c1c4b4cd@web.de \
    --to=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.