All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btrfs: remove redundant NULL check
@ 2021-01-21  8:19 Yang Li
  2021-01-21 10:29 ` Anand Jain
  2021-01-21 16:35 ` David Sterba
  0 siblings, 2 replies; 3+ messages in thread
From: Yang Li @ 2021-01-21  8:19 UTC (permalink / raw)
  To: clm; +Cc: josef, dsterba, linux-btrfs, linux-kernel, Yang Li

Fix below warnings reported by coccicheck:
./fs/btrfs/raid56.c:237:2-8: WARNING: NULL check before some freeing
functions is not needed.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <abaci-bugfix@linux.alibaba.com>
---
 fs/btrfs/raid56.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/btrfs/raid56.c b/fs/btrfs/raid56.c
index 93fbf87..5394641 100644
--- a/fs/btrfs/raid56.c
+++ b/fs/btrfs/raid56.c
@@ -233,8 +233,7 @@ int btrfs_alloc_stripe_hash_table(struct btrfs_fs_info *info)
 	}
 
 	x = cmpxchg(&info->stripe_hash_table, NULL, table);
-	if (x)
-		kvfree(x);
+	kvfree(x);
 	return 0;
 }
 
-- 
1.8.3.1


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

* Re: [PATCH] btrfs: remove redundant NULL check
  2021-01-21  8:19 [PATCH] btrfs: remove redundant NULL check Yang Li
@ 2021-01-21 10:29 ` Anand Jain
  2021-01-21 16:35 ` David Sterba
  1 sibling, 0 replies; 3+ messages in thread
From: Anand Jain @ 2021-01-21 10:29 UTC (permalink / raw)
  To: Yang Li, clm; +Cc: josef, dsterba, linux-btrfs, linux-kernel

On 21/1/21 4:19 pm, Yang Li wrote:
> Fix below warnings reported by coccicheck:
> ./fs/btrfs/raid56.c:237:2-8: WARNING: NULL check before some freeing
> functions is not needed.
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Yang Li <abaci-bugfix@linux.alibaba.com>
> ---
>   fs/btrfs/raid56.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/fs/btrfs/raid56.c b/fs/btrfs/raid56.c
> index 93fbf87..5394641 100644
> --- a/fs/btrfs/raid56.c
> +++ b/fs/btrfs/raid56.c
> @@ -233,8 +233,7 @@ int btrfs_alloc_stripe_hash_table(struct btrfs_fs_info *info)
>   	}
>   
>   	x = cmpxchg(&info->stripe_hash_table, NULL, table);
> -	if (x)
> -		kvfree(x);
> +	kvfree(x);



  Reviewed-by: Anand Jain <anand.jain@oracle.com>

Thanks, Anand


>   	return 0;
>   }
>   
> 


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

* Re: [PATCH] btrfs: remove redundant NULL check
  2021-01-21  8:19 [PATCH] btrfs: remove redundant NULL check Yang Li
  2021-01-21 10:29 ` Anand Jain
@ 2021-01-21 16:35 ` David Sterba
  1 sibling, 0 replies; 3+ messages in thread
From: David Sterba @ 2021-01-21 16:35 UTC (permalink / raw)
  To: Yang Li; +Cc: clm, josef, dsterba, linux-btrfs, linux-kernel

On Thu, Jan 21, 2021 at 04:19:47PM +0800, Yang Li wrote:
> Fix below warnings reported by coccicheck:
> ./fs/btrfs/raid56.c:237:2-8: WARNING: NULL check before some freeing
> functions is not needed.
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Yang Li <abaci-bugfix@linux.alibaba.com>

Added to misc-next, thanks.

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

end of thread, other threads:[~2021-01-21 16:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-21  8:19 [PATCH] btrfs: remove redundant NULL check Yang Li
2021-01-21 10:29 ` Anand Jain
2021-01-21 16:35 ` David Sterba

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.