All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][next] ttyprintk: remove redundant initialization of variable i
@ 2021-05-18 18:21 Colin King
  2021-05-21 12:40 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 4+ messages in thread
From: Colin King @ 2021-05-18 18:21 UTC (permalink / raw)
  To: Arnd Bergmann, Greg Kroah-Hartman; +Cc: kernel-janitors, linux-kernel

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

The variable i is being initialized with a value that is never read,
it is being updated later on.  The assignment is redundant and can be
removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/char/ttyprintk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/char/ttyprintk.c b/drivers/char/ttyprintk.c
index 219fa1382396..230b2c9b3e3c 100644
--- a/drivers/char/ttyprintk.c
+++ b/drivers/char/ttyprintk.c
@@ -52,7 +52,7 @@ static void tpk_flush(void)
 
 static int tpk_printk(const unsigned char *buf, int count)
 {
-	int i = tpk_curr;
+	int i;
 
 	for (i = 0; i < count; i++) {
 		if (tpk_curr >= TPK_STR_SIZE) {
-- 
2.31.1


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

end of thread, other threads:[~2021-05-27 12:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-18 18:21 [PATCH][next] ttyprintk: remove redundant initialization of variable i Colin King
2021-05-21 12:40 ` Greg Kroah-Hartman
2021-05-25  8:54   ` Colin Ian King
2021-05-27 12:20     ` Greg Kroah-Hartman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.