[PATCH] ttyprintk: remove redundant initialization of variable ret

From: Colin King
Date: Thu Jun 11 2020 - 11:31:13 EST


From: Colin Ian King <colin.king@xxxxxxxxxxxxx>

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@xxxxxxxxxxxxx>
---
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 56db949a7b70..6a0059e508e3 100644
--- a/drivers/char/ttyprintk.c
+++ b/drivers/char/ttyprintk.c
@@ -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);

--
2.27.0.rc0