Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: Ou Shixiong <oushixiong@kylinos.cn>, Chris Mason <clm@fb.com>
Cc: Josef Bacik <josef@toxicpanda.com>,
	David Sterba <dsterba@suse.com>,
	linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] btrfs: scrub: initialize variable explicitly
Date: Thu, 8 Jun 2023 13:18:20 +0800	[thread overview]
Message-ID: <230384e8-55dc-579d-64e8-0c0263b72673@gmx.com> (raw)
In-Reply-To: <20230608024901.221232-1-oushixiong@kylinos.cn>



On 2023/6/8 10:49, Ou Shixiong wrote:
>
> Fix error of
> error: ‘ret’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
>
> Signed-off-by: Ou Shixiong <oushixiong@kylinos.cn>

Not again.

Please explain how @ret can be uninitialized, and your toolchain version.

To me, this looks like a false alert, and it's possible your toolchain
is out of date or lacks certain backports.

Thanks,
Qu
> ---
>   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 28caad17ccc7..0d5c87c52c33 100644
> --- a/fs/btrfs/scrub.c
> +++ b/fs/btrfs/scrub.c
> @@ -1962,7 +1962,7 @@ static int scrub_simple_mirror(struct scrub_ctx *sctx,
>   	/* An artificial limit, inherit from old scrub behavior */
>   	struct btrfs_path path = { 0 };
>   	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);
>
>
> Content-type: Text/plain
>
> No virus found
> 		Checked by Hillstone Network AntiVirus

  reply	other threads:[~2023-06-08  5:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-08  2:49 [PATCH] btrfs: scrub: initialize variable explicitly Ou Shixiong
2023-06-08  5:18 ` Qu Wenruo [this message]
2023-06-08 12:46   ` David Sterba

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=230384e8-55dc-579d-64e8-0c0263b72673@gmx.com \
    --to=quwenruo.btrfs@gmx.com \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oushixiong@kylinos.cn \
    /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