All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fs-udf: Delete an unnecessary check before brelse()
@ 2019-09-03 19:15 ` Markus Elfring
  0 siblings, 0 replies; 4+ messages in thread
From: Markus Elfring @ 2019-09-03 19:15 UTC (permalink / raw)
  To: kernel-janitors, Jan Kara; +Cc: LKML

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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] fs-udf: Delete an unnecessary check before brelse()
@ 2019-09-03 19:15 ` Markus Elfring
  0 siblings, 0 replies; 4+ messages in thread
From: Markus Elfring @ 2019-09-03 19:15 UTC (permalink / raw)
  To: kernel-janitors, Jan Kara; +Cc: LKML

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] fs-udf: Delete an unnecessary check before brelse()
  2019-09-03 19:15 ` Markus Elfring
@ 2019-09-04  7:48   ` Jan Kara
  -1 siblings, 0 replies; 4+ messages in thread
From: Jan Kara @ 2019-09-04  7:48 UTC (permalink / raw)
  To: Markus Elfring; +Cc: Jan Kara, kernel-janitors, LKML

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] fs-udf: Delete an unnecessary check before brelse()
@ 2019-09-04  7:48   ` Jan Kara
  0 siblings, 0 replies; 4+ messages in thread
From: Jan Kara @ 2019-09-04  7:48 UTC (permalink / raw)
  To: Markus Elfring; +Cc: Jan Kara, kernel-janitors, LKML

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-09-04  7:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-03 19:15 [PATCH] fs-udf: Delete an unnecessary check before brelse() Markus Elfring
2019-09-03 19:15 ` Markus Elfring
2019-09-04  7:48 ` Jan Kara
2019-09-04  7:48   ` Jan Kara

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.