Skip to contentSkip to conversation

mtd: cfi: remove redundant assignment to variable timeo

PATCH Applied Colin King 2 participants 2 messages Mar 25, 2021 – Apr 13, 2021

Subsystems (2)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 mtd: cfi: remove redundant assignment to variable timeo

From: Colin Ian King <[email protected]>

The variable timeo is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed.

Addresses-Coverity: ("Unused value")

---
 drivers/mtd/chips/cfi_cmdset_0002.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/chips/cfi_cmdset_0002.c +1 -1
index 6f6b0265c22d..54926b72c331 100644
@@ -1650,7 +1650,7 @@ static int __xipram do_write_oneword_once(struct map_info *map,
 					  unsigned long adr, map_word datum,
 					  int mode, struct cfi_private *cfi)
 {
-	unsigned long timeo = jiffies + HZ;
+	unsigned long timeo;
 	/*
 	 * We use a 1ms + 1 jiffies generic timeout for writes (most devices
 	 * have a max write time of a few hundreds usec). However, we should
Signature · 1 line
2.30.2
maintainer Applied
#1 lore raw

Hi Colin King,

Quoted 3 lines · Colin King

The variable timeo is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed.

Fixed up $subject prefix to match existing convention for the file.

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git cfi/next, thanks! [1/1] mtd: cfi: remove redundant assignment to variable timeo

      https://git.kernel.org/mtd/c/f3907773d6

--
Regards
Vignesh