ttyprintk: remove redundant initialization of variable ret
authorColin Ian King <colin.king@canonical.com>
Thu, 11 Jun 2020 15:31:08 +0000 (16:31 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Jul 2020 12:50:51 +0000 (14:50 +0200)
The variable ret 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>
Link: https://lore.kernel.org/r/20200611153108.927614-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/ttyprintk.c

index 56db949..6a0059e 100644 (file)
@@ -172,7 +172,7 @@ static struct tty_driver *ttyprintk_driver;
 
 static int __init ttyprintk_init(void)
 {
-       int ret = -ENOMEM;
+       int ret;
 
        spin_lock_init(&tpk_port.spinlock);