linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mtd: cfi: remove redundant assignment to variable timeo
@ 2021-03-25 17:45 Colin King
  2021-04-13 16:23 ` Vignesh Raghavendra
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2021-03-25 17:45 UTC (permalink / raw)
  To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra, linux-mtd
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

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")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/mtd/chips/cfi_cmdset_0002.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c
index 6f6b0265c22d..54926b72c331 100644
--- a/drivers/mtd/chips/cfi_cmdset_0002.c
+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
@@ -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
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mtd: cfi: remove redundant assignment to variable timeo
  2021-03-25 17:45 [PATCH] mtd: cfi: remove redundant assignment to variable timeo Colin King
@ 2021-04-13 16:23 ` Vignesh Raghavendra
  0 siblings, 0 replies; 2+ messages in thread
From: Vignesh Raghavendra @ 2021-04-13 16:23 UTC (permalink / raw)
  To: linux-mtd, Colin King, Richard Weinberger, Miquel Raynal
  Cc: Vignesh Raghavendra, linux-kernel, kernel-janitors

Hi Colin King,

On Thu, 25 Mar 2021 17:45:14 +0000, Colin King wrote:
> 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-04-13 16:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-25 17:45 [PATCH] mtd: cfi: remove redundant assignment to variable timeo Colin King
2021-04-13 16:23 ` Vignesh Raghavendra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).