ttyprintk: remove redundant initialization of variable i
authorColin Ian King <colin.king@canonical.com>
Tue, 18 May 2021 18:21:26 +0000 (19:21 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 May 2021 12:19:50 +0000 (14:19 +0200)
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.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Addresses-Coverity: ("Unused value")
Link: https://lore.kernel.org/r/20210518182126.140978-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/ttyprintk.c

index 219fa13..230b2c9 100644 (file)
@@ -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) {