lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Mon, 24 Jan 2022 20:43:59 +0100
From:   David Sterba <dsterba@...e.cz>
To:     Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
Cc:     clm@...com, josef@...icpanda.com, dsterba@...e.com,
        linux-btrfs@...r.kernel.org, linux-kernel@...r.kernel.org,
        Abaci Robot <abaci@...ux.alibaba.com>
Subject: Re: [PATCH] btrfs: scrub: Remove redundant initialization of
 increment

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@...ux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@...ux.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.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ