Skip to contentSkip to conversation

mtd: tests: Remove redundant assignment to err

PATCH Applied Yang Li 2 participants 2 messages Apr 28, 2021 – May 10, 2021 Memory technology devices (MTD)

lore
Share & tools
lore

Yang Li

author
#0 lore raw

PATCH 1/1 mtd: tests: Remove redundant assignment to err

Variable 'err' is set to 0 but this value is never read as it is overwritten with a new value later on, hence it is a redundant assignment and can be removed.

Cleans up the following clang-analyzer warning:

drivers/mtd/tests/torturetest.c:233:2: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]

---
 drivers/mtd/tests/torturetest.c | 2 --
 1 file changed, 2 deletions(-)
drivers/mtd/tests/torturetest.c +0 -2
index 6787ac5..841689b 100644
@@ -230,8 +230,6 @@ static int __init tort_init(void)
 	if (!bad_ebs)
 		goto out_check_buf;
 
-	err = 0;
-
 	/* Initialize patterns */
 	memset(patt_FF, 0xFF, mtd->erasesize);
 	for (i = 0; i < mtd->erasesize / pgsize; i++) {
Signature · 1 line
1.8.3.1
maintainer Applied
#1 lore raw
Quoted 11 lines · Yang Li

Variable 'err' is set to 0 but this value is never read as it is overwritten with a new value later on, hence it is a redundant assignment and can be removed.

Cleans up the following clang-analyzer warning:

drivers/mtd/tests/torturetest.c:233:2: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]

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

Miquel

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/