* [PATCH][next] mtd: chips: remove redundant assignment to variable timeo
@ 2024-02-15 14:01 Colin Ian King
2024-02-26 10:43 ` Miquel Raynal
0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2024-02-15 14:01 UTC (permalink / raw)
To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra, linux-mtd
Cc: kernel-janitors, linux-kernel
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>
---
drivers/mtd/chips/cfi_cmdset_0002.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c
index df589d9b4d70..9f2223d3e8e1 100644
--- a/drivers/mtd/chips/cfi_cmdset_0002.c
+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
@@ -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;
--
2.39.2
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH][next] mtd: chips: remove redundant assignment to variable timeo
2024-02-15 14:01 [PATCH][next] mtd: chips: remove redundant assignment to variable timeo Colin Ian King
@ 2024-02-26 10:43 ` Miquel Raynal
0 siblings, 0 replies; 2+ messages in thread
From: Miquel Raynal @ 2024-02-26 10:43 UTC (permalink / raw)
To: Colin Ian King, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra, linux-mtd
Cc: kernel-janitors, linux-kernel
On Thu, 2024-02-15 at 14:01:06 UTC, Colin Ian King wrote:
> 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>
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks.
Miquel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-02-26 10:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-15 14:01 [PATCH][next] mtd: chips: remove redundant assignment to variable timeo Colin Ian King
2024-02-26 10:43 ` Miquel Raynal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®