From: Colin Ian King Date: Tue, 18 May 2021 18:21:26 +0000 (+0100) Subject: ttyprintk: remove redundant initialization of variable i X-Git-Tag: v5.14-rc1~65^2~113 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=18c092e5c35ece7fa1fe0b2c6f8c4a13da3fc641;p=thirdparty%2Fkernel%2Flinux.git ttyprintk: remove redundant initialization of variable i 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 Addresses-Coverity: ("Unused value") Link: https://lore.kernel.org/r/20210518182126.140978-1-colin.king@canonical.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/char/ttyprintk.c b/drivers/char/ttyprintk.c index 219fa13823960..230b2c9b3e3cd 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) {