Skip to contentSkip to conversation

mtd: rawnand: remove redundant assignment to variable bbtblocks

PATCH Applied Colin Ian King 2 participants 2 messages Feb 9, 2024 – Feb 26, 2024

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

PATCH 1/1 mtd: rawnand: remove redundant assignment to variable bbtblocks

The variable bbtblocks is being assigned a value that is never read. The assignment is redundant and can be removed.

Cleans up clang scan build warning:
drivers/mtd/nand/raw/nand_bbt.c:579:3: warning: Value stored to 'bbtblocks' is never read [deadcode.DeadStores]

---
 drivers/mtd/nand/raw/nand_bbt.c | 1 -
 1 file changed, 1 deletion(-)
drivers/mtd/nand/raw/nand_bbt.c +0 -1
index e4664fa6fd9e..a8fba5f39f59 100644
@@ -576,7 +576,6 @@ static int search_bbt(struct nand_chip *this, uint8_t *buf,
 		startblock &= bbtblocks - 1;
 	} else {
 		chips = 1;
-		bbtblocks = mtd->size >> this->bbt_erase_shift;
 	}
 
 	for (i = 0; i < chips; i++) {
Signature · 1 line
2.39.2
maintainer Applied
#1 lore raw
Quoted 8 lines · Colin Ian King

The variable bbtblocks is being assigned a value that is never read. The assignment is redundant and can be removed.

Cleans up clang scan build warning:
drivers/mtd/nand/raw/nand_bbt.c:579:3: warning: Value stored to 'bbtblocks' is never read [deadcode.DeadStores]

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.

Miquel