[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220423113811.13335-1-michalorzel.eng@gmail.com>
Date: Sat, 23 Apr 2022 13:38:07 +0200
From: Michal Orzel <michalorzel.eng@...il.com>
To: Jens Axboe <axboe@...nel.dk>,
Nathan Chancellor <nathan@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Tom Rix <trix@...hat.com>
Cc: Michal Orzel <michalorzel.eng@...il.com>,
linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
llvm@...ts.linux.dev
Subject: [PATCH RESEND v2 1/5] 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: Michal Orzel <michalorzel.eng@...il.com>
---
block/badblocks.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/block/badblocks.c b/block/badblocks.c
index d39056630d9c..3afb550c0f7b 100644
--- a/block/badblocks.c
+++ b/block/badblocks.c
@@ -65,7 +65,6 @@ int badblocks_check(struct badblocks *bb, sector_t s, int sectors,
s >>= bb->shift;
target += (1<<bb->shift) - 1;
target >>= bb->shift;
- sectors = target - s;
}
/* '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)
s += (1<<bb->shift) - 1;
s >>= bb->shift;
target >>= bb->shift;
- sectors = target - s;
}
write_seqlock_irq(&bb->lock);
--
2.25.1
Powered by blists - more mailing lists