mtd: chips: remove redundant assignment to variable timeo
authorColin Ian King <colin.i.king@gmail.com>
Thu, 15 Feb 2024 14:01:06 +0000 (14:01 +0000)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Mon, 26 Feb 2024 10:26:28 +0000 (11:26 +0100)
In two functions the variable timeo is being initialized with a value
that is never read, it is being re-assigned later on. The initializations
are redundant and can be removed.

Cleans up clang scan build warning:
warning: Value stored to 'timeo' during its initialization is never
read [deadcode.DeadStores]

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20240215140106.2062858-1-colin.i.king@gmail.com
drivers/mtd/chips/cfi_cmdset_0002.c

index df589d9b4d705553ead2b0948fa8d3e19ade13d9..9f2223d3e8e119a96e22fd1bbe399d63abf9bcfc 100644 (file)
@@ -2411,7 +2411,7 @@ static int cfi_amdstd_panic_write(struct mtd_info *mtd, loff_t to, size_t len,
 static int __xipram do_erase_chip(struct map_info *map, struct flchip *chip)
 {
        struct cfi_private *cfi = map->fldrv_priv;
-       unsigned long timeo = jiffies + HZ;
+       unsigned long timeo;
        unsigned long int adr;
        DECLARE_WAITQUEUE(wait, current);
        int ret;
@@ -2512,7 +2512,7 @@ static int __xipram do_erase_chip(struct map_info *map, struct flchip *chip)
 static int __xipram do_erase_oneblock(struct map_info *map, struct flchip *chip, unsigned long adr, int len, void *thunk)
 {
        struct cfi_private *cfi = map->fldrv_priv;
-       unsigned long timeo = jiffies + HZ;
+       unsigned long timeo;
        DECLARE_WAITQUEUE(wait, current);
        int ret;
        int retry_cnt = 0;