mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Cc: clm@fb.com, josef@toxicpanda.com, dsterba@suse.com,
	linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org,
	Abaci Robot <abaci@linux.alibaba.com>
Subject: Re: [PATCH] btrfs: scrub: Remove redundant initialization of increment
Date: Mon, 24 Jan 2022 20:43:59 +0100	[thread overview]
Message-ID: <20220124194359.GE14046@twin.jikos.cz> (raw)
In-Reply-To: <20220121114224.92247-1-jiapeng.chong@linux.alibaba.com>

On Fri, Jan 21, 2022 at 07:42:24PM +0800, Jiapeng Chong wrote:
> increment is being initialized to map->stripe_len but this is never
> read as increment is overwritten later on. Remove the redundant
> initialization.

> 
> Cleans up the following clang-analyzer warning:
> 
> fs/btrfs/scrub.c:3193:6: warning: Value stored to 'increment' during its
> initialization is never read [clang-analyzer-deadcode.DeadStores].
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> ---
>  fs/btrfs/scrub.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
> index 2e9a322773f2..38f5666eff14 100644
> --- a/fs/btrfs/scrub.c
> +++ b/fs/btrfs/scrub.c
> @@ -3209,7 +3209,6 @@ static noinline_for_stack int scrub_stripe(struct scrub_ctx *sctx,
>  	offset = 0;
>  	nstripes = div64_u64(dev_extent_len, map->stripe_len);
>  	mirror_num = 1;
> -	increment = map->stripe_len;

I'd rather remove the initialization at the declarataion, the other
values are initialized here so it's all in one place. As is's a minor
change I'll do that at commit time, no need to resend. Thanks.

      reply	other threads:[~2022-01-24 19:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-21 11:42 Jiapeng Chong
2022-01-24 19:43 ` David Sterba [this message]

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=20220124194359.GE14046@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=abaci@linux.alibaba.com \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=jiapeng.chong@linux.alibaba.com \
    --cc=josef@toxicpanda.com \
    --cc=linux-btrfs@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®