[PATCH] printk: fix returnvar.cocci warnings

From: kernel test robot
Date: Thu Jul 08 2021 - 11:17:46 EST


From: kernel test robot <lkp@xxxxxxxxx>

kernel/printk/printk.c:2189:5-8: Unneeded variable: "ret". Return "- ENOMEM" on line 2294


Remove unneeded variable used to store return value.

Generated by: scripts/coccinelle/misc/returnvar.cocci

Fixes: c4049cfc8a03 ("printk: move console printing to kthreads")
CC: John Ogness <john.ogness@xxxxxxxxxxxxx>
Reported-by: kernel test robot <lkp@xxxxxxxxx>
Signed-off-by: kernel test robot <lkp@xxxxxxxxx>
---

tree: https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git linux-5.13.y-rt-rebase
head: 7e175e6b59975c8901ad370f7818937f68de45c1
commit: c4049cfc8a0327c22d56855882d8e2cffd6d20fa [11/222] printk: move console printing to kthreads
:::::: branch date: 19 hours ago
:::::: commit date: 19 hours ago

printk.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -2186,7 +2186,6 @@ static int printk_kthread_func(void *dat
struct printk_record r;
char *ext_text = NULL;
size_t dropped_len;
- int ret = -ENOMEM;
char *text = NULL;
char *write_text;
size_t len;
@@ -2291,7 +2290,7 @@ out:
pr_info("%sconsole [%s%d]: printing thread stopped\n",
(con->flags & CON_BOOT) ? "boot" : "",
con->name, con->index);
- return ret;
+ return -ENOMEM;
}

/* Must be called within console_lock(). */