Commit 3de2e5f2 authored by Michal Orzel's avatar Michal Orzel Committed by Jens Axboe

block/badblocks: Remove redundant assignments

Get rid of redundant assignments to a variable sectors from functions
badblocks_check and badblocks_clear. This variable, that is a function
parameter, is being assigned a value that is never read until the end of
function.

Reported by clang-tidy [deadcode.DeadStores]
Signed-off-by: default avatarMichal Orzel <michalorzel.eng@gmail.com>
Link: https://lore.kernel.org/r/20220423113811.13335-1-michalorzel.eng@gmail.comSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 5f0614a5
...@@ -65,7 +65,6 @@ int badblocks_check(struct badblocks *bb, sector_t s, int sectors, ...@@ -65,7 +65,6 @@ int badblocks_check(struct badblocks *bb, sector_t s, int sectors,
s >>= bb->shift; s >>= bb->shift;
target += (1<<bb->shift) - 1; target += (1<<bb->shift) - 1;
target >>= bb->shift; target >>= bb->shift;
sectors = target - s;
} }
/* 'target' is now the first block after the bad range */ /* 'target' is now the first block after the bad range */
...@@ -345,7 +344,6 @@ int badblocks_clear(struct badblocks *bb, sector_t s, int sectors) ...@@ -345,7 +344,6 @@ int badblocks_clear(struct badblocks *bb, sector_t s, int sectors)
s += (1<<bb->shift) - 1; s += (1<<bb->shift) - 1;
s >>= bb->shift; s >>= bb->shift;
target >>= bb->shift; target >>= bb->shift;
sectors = target - s;
} }
write_seqlock_irq(&bb->lock); write_seqlock_irq(&bb->lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment