Skip to contentSkip to conversation

mtd: cfi_cmdset_0002: remove redundant assignment to variable ret

PATCH Applied Colin Ian King 2 participants 2 messages Oct 2, 2024 – Oct 21, 2024

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

PATCH 1/1 mtd: cfi_cmdset_0002: remove redundant assignment to variable ret

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.

---
 drivers/mtd/chips/cfi_cmdset_0002.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/mtd/chips/cfi_cmdset_0002.c +1 -3
index 9f2223d3e8e1..7c91429a670b 100644
@@ -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,
Signature · 1 line
2.39.5