btrfs: scrub: Remove redundant initialization of increment
PATCH 1/1 btrfs: scrub: Remove redundant initialization of increment
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].
--- fs/btrfs/scrub.c | 1 - 1 file changed, 1 deletion(-)
fs/btrfs/scrub.c +0 -1
@@ -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;if (map->type &BTRFS_BLOCK_GROUP_RAID0 ) { offset = map->stripe_len * stripe_index; increment = map->stripe_len * map->num_stripes;
Signature · 1 line
2.20.1.7.g153144c
Quoted 21 lines · Jiapeng Chong
increment is being initialized to
map->stripe_lenbut 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 <[email protected]>Signed-off-by Jiapeng Chong <[email protected]>--- fs/btrfs/scrub.c | 1 - 1 file changed, 1 deletion(-)fs/btrfs/scrub.c +0
-0
fs/btrfs/scrub.c static noinline_for_stack int scrub_stripe(struct scrub_ctx *sctx, · line 3212
Quoted 4 lines
fs/btrfs/scrub.c +0
-1@@ -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.