[PATCH][next] mtd: cfi_cmdset_0002: remove redundant assignment to variable ret
Colin Ian King
colin.i.king at gmail.com
Wed Oct 2 10:22:58 PDT 2024
Variable ret is being assigned a value that is never read, the following
goto statement jumps to a statement that assigns ret a return from the
call to function do_write_oneword_once. The assignment is redundant
and can be removed.
Signed-off-by: Colin Ian King <colin.i.king at gmail.com>
---
drivers/mtd/chips/cfi_cmdset_0002.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c
index 9f2223d3e8e1..7c91429a670b 100644
--- a/drivers/mtd/chips/cfi_cmdset_0002.c
+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
@@ -1775,18 +1775,16 @@ static int __xipram do_write_oneword_retry(struct map_info *map,
retry:
ret = do_write_oneword_once(map, chip, adr, datum, mode, cfi);
if (ret) {
/* reset on all failures. */
map_write(map, CMD(0xF0), chip->start);
/* FIXME - should have reset delay before continuing */
- if (++retry_cnt <= MAX_RETRIES) {
- ret = 0;
+ if (++retry_cnt <= MAX_RETRIES)
goto retry;
- }
}
xip_enable(map, chip, adr);
return ret;
}
static int __xipram do_write_oneword(struct map_info *map, struct flchip *chip,
--
2.39.5
More information about the linux-mtd
mailing list