All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btrfs: scrub: fix a compilation warning
@ 2024-05-07  2:34 Lu Yao
  2024-05-08 15:37 ` Boris Burkov
  2024-05-13 18:58 ` David Sterba
  0 siblings, 2 replies; 3+ messages in thread
From: Lu Yao @ 2024-05-07  2:34 UTC (permalink / raw)
  To: clm, josef, dsterba; +Cc: linux-btrfs, linux-kernel, Lu Yao

The following error message is displayed:
  ../fs/btrfs/scrub.c:2152:9: error: ‘ret’ may be used uninitialized
  in this function [-Werror=maybe-uninitialized]"

Signed-off-by: Lu Yao <yaolu@kylinos.cn>
---
gcc version: (Debian 10.2.1-6) 10.2.1 20210110
---
 fs/btrfs/scrub.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
index 4b22cfe9a98c..afd6932f5e89 100644
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@ -2100,7 +2100,7 @@ static int scrub_simple_mirror(struct scrub_ctx *sctx,
 	struct btrfs_fs_info *fs_info = sctx->fs_info;
 	const u64 logical_end = logical_start + logical_length;
 	u64 cur_logical = logical_start;
-	int ret;
+	int ret = 0;
 
 	/* The range must be inside the bg */
 	ASSERT(logical_start >= bg->start && logical_end <= bg->start + bg->length);
-- 
2.25.1


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

* Re: [PATCH] btrfs: scrub: fix a compilation warning
  2024-05-07  2:34 [PATCH] btrfs: scrub: fix a compilation warning Lu Yao
@ 2024-05-08 15:37 ` Boris Burkov
  2024-05-13 18:58 ` David Sterba
  1 sibling, 0 replies; 3+ messages in thread
From: Boris Burkov @ 2024-05-08 15:37 UTC (permalink / raw)
  To: Lu Yao; +Cc: clm, josef, dsterba, linux-btrfs, linux-kernel

On Tue, May 07, 2024 at 10:34:17AM +0800, Lu Yao wrote:
> The following error message is displayed:
>   ../fs/btrfs/scrub.c:2152:9: error: ‘ret’ may be used uninitialized
>   in this function [-Werror=maybe-uninitialized]"
> 
> Signed-off-by: Lu Yao <yaolu@kylinos.cn>
Reviewed-by: Boris Burkov <boris@bur.io>
> ---
> gcc version: (Debian 10.2.1-6) 10.2.1 20210110
> ---
>  fs/btrfs/scrub.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
> index 4b22cfe9a98c..afd6932f5e89 100644
> --- a/fs/btrfs/scrub.c
> +++ b/fs/btrfs/scrub.c
> @@ -2100,7 +2100,7 @@ static int scrub_simple_mirror(struct scrub_ctx *sctx,
>  	struct btrfs_fs_info *fs_info = sctx->fs_info;
>  	const u64 logical_end = logical_start + logical_length;
>  	u64 cur_logical = logical_start;
> -	int ret;
> +	int ret = 0;
>  
>  	/* The range must be inside the bg */
>  	ASSERT(logical_start >= bg->start && logical_end <= bg->start + bg->length);
> -- 
> 2.25.1
> 

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

* Re: [PATCH] btrfs: scrub: fix a compilation warning
  2024-05-07  2:34 [PATCH] btrfs: scrub: fix a compilation warning Lu Yao
  2024-05-08 15:37 ` Boris Burkov
@ 2024-05-13 18:58 ` David Sterba
  1 sibling, 0 replies; 3+ messages in thread
From: David Sterba @ 2024-05-13 18:58 UTC (permalink / raw)
  To: Lu Yao; +Cc: clm, josef, dsterba, linux-btrfs, linux-kernel

On Tue, May 07, 2024 at 10:34:17AM +0800, Lu Yao wrote:
> The following error message is displayed:
>   ../fs/btrfs/scrub.c:2152:9: error: ‘ret’ may be used uninitialized
>   in this function [-Werror=maybe-uninitialized]"
> 
> Signed-off-by: Lu Yao <yaolu@kylinos.cn>
> ---
> gcc version: (Debian 10.2.1-6) 10.2.1 20210110

The compiler version should be in the changelog as we want to know which
version produces the warning, but otherwise ok. Patch added to for-next,
thanks.

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

end of thread, other threads:[~2024-05-13 19:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-07  2:34 [PATCH] btrfs: scrub: fix a compilation warning Lu Yao
2024-05-08 15:37 ` Boris Burkov
2024-05-13 18:58 ` 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.