Skip to contentSkip to conversation

btrfs: scrub: remove redundant division of stripe_nr

PATCH In review Colin Ian King 2 participants 2 messages Jun 21, 2023 – Jun 29, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 btrfs: scrub: remove redundant division of stripe_nr

Variable stripe_nr is being divided by map->num_stripes however the result is never read. The division and assignment are redundant and can be removed. Cleans up clang scan build warning:

fs/btrfs/scrub.c:1264:3: warning: Value stored to 'stripe_nr' is never read [deadcode.DeadStores]

---
 fs/btrfs/scrub.c | 1 -
 1 file changed, 1 deletion(-)
fs/btrfs/scrub.c +0 -1
index 2c7fdbb60314..8fc4f9ea3d20 100644
@@ -1261,7 +1261,6 @@ static int get_raid56_logic_offset(u64 physical, int num,
 
 		/* Work out the disk rotation on this stripe-set */
 		rot = stripe_nr % map->num_stripes;
-		stripe_nr /= map->num_stripes;
 		/* calculate which stripe this data locates */
 		rot += i;
 		stripe_index = rot % map->num_stripes;
Signature · 1 line
2.39.2
#1 lore raw
Quoted 8 lines · Colin Ian King

Variable stripe_nr is being divided by map->num_stripes however the result is never read. The division and assignment are redundant and can be removed. Cleans up clang scan build warning:

fs/btrfs/scrub.c:1264:3: warning: Value stored to 'stripe_nr' is never read [deadcode.DeadStores]

Added to misc-next, thanks.