linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/5] block/badblocks: Remove redundant assignments
@ 2022-04-12 17:16 Michal Orzel
  2022-04-12 17:16 ` [PATCH v2 2/5] block/blk-map: Remove redundant assignment Michal Orzel
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Michal Orzel @ 2022-04-12 17:16 UTC (permalink / raw)
  To: Jens Axboe, Nathan Chancellor, Nick Desaulniers, Tom Rix
  Cc: Michal Orzel, linux-block, linux-kernel, llvm

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@gmail.com>
---
Changes since v1:
-move the change into a separate patch
-add analysis
---
 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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-04-12 17:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-12 17:16 [PATCH v2 1/5] block/badblocks: Remove redundant assignments Michal Orzel
2022-04-12 17:16 ` [PATCH v2 2/5] block/blk-map: Remove redundant assignment Michal Orzel
2022-04-12 17:16 ` [PATCH v2 3/5] block/partitions/acorn: Remove redundant assignments Michal Orzel
2022-04-12 17:16 ` [PATCH v2 4/5] block/partitions/atari: Remove redundant assignment Michal Orzel
2022-04-12 17:16 ` [PATCH v2 5/5] block/partitions/ldm: Remove redundant assignments Michal Orzel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).