From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: [PATCH] printk: fix returnvar.cocci warnings
Date: Sun, 01 Nov 2020 21:05:06 +0800 [thread overview]
Message-ID: <20201101130506.GA6756@4f72a4574d93> (raw)
In-Reply-To: <202011012100.rzwEcHrE-lkp@intel.com>
[-- Attachment #1: Type: text/plain, Size: 1861 bytes --]
CC: kbuild-all(a)lists.01.org
TO: John Ogness <john.ogness@linutronix.de>
CC: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
From: kernel test robot <lkp@intel.com>
kernel/printk/printk.c:2808:5-8: Unneeded variable: "ret". Return "- ENOMEM" on line 2819
Remove unneeded variable used to store return value.
Generated by: scripts/coccinelle/misc/returnvar.cocci
Fixes: ca4fcaa60de9 ("printk: move console printing to kthreads")
CC: John Ogness <john.ogness@linutronix.de>
Signed-off-by: kernel test robot <lkp@intel.com>
---
tree: https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git linux-5.10.y-rt-rebase
head: 87b7b3d2cb296950a0e3005406899ccfbbc9da7c
commit: ca4fcaa60de914c0ef6864983a8488bf5ab6cafb [57/209] printk: move console printing to kthreads
:::::: branch date: 2 days ago
:::::: commit date: 2 days ago
Please take the patch only if it's a positive warning. Thanks!
printk.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -2805,7 +2805,6 @@ static int printk_kthread_func(void *dat
char *ext_text = NULL;
size_t dropped_len;
char *dropped_text;
- int ret = -ENOMEM;
char *write_text;
u64 printk_seq;
size_t len;
@@ -2816,7 +2815,7 @@ static int printk_kthread_func(void *dat
if (con->flags & CON_EXTENDED) {
ext_text = kmalloc(CONSOLE_EXT_LOG_MAX, GFP_KERNEL);
if (!ext_text)
- return ret;
+ return -ENOMEM;
}
text = kmalloc(LOG_LINE_MAX + PREFIX_MAX, GFP_KERNEL);
dropped_text = kmalloc(64, GFP_KERNEL);
@@ -2904,7 +2903,7 @@ out:
pr_info("%sconsole [%s%d]: printing thread stopped\n",
(con->flags & CON_BOOT) ? "boot" : "" ,
con->name, con->index);
- return ret;
+ return -ENOMEM;
}
static void start_printk_kthread(struct console *con)
next prev parent reply other threads:[~2020-11-01 13:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-01 13:05 [linux-rt-devel:linux-5.10.y-rt-rebase 57/209] kernel/printk/printk.c:2808:5-8: Unneeded variable: "ret". Return "- ENOMEM" on line 2819 kernel test robot
2020-11-01 13:05 ` kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2021-01-22 9:03 [linux-rt-devel:linux-5.11.y-rt-rebase 34/184] kernel/printk/printk.c:2127:5-8: Unneeded variable: "ret". Return "- ENOMEM" on line 2226 kernel test robot
2021-01-22 9:03 ` [PATCH] printk: fix returnvar.cocci warnings kernel test robot
2021-02-19 19:08 [linux-rt-devel:linux-5.11.y-rt-rebase 36/199] kernel/printk/printk.c:2145:5-8: Unneeded variable: "ret". Return "- ENOMEM" on line 2244 kernel test robot
2021-02-19 19:08 ` [PATCH] printk: fix returnvar.cocci warnings kernel test robot
2021-03-20 5:22 [linux-rt-devel:linux-5.12.y-rt-rebase 32/193] kernel/printk/printk.c:2195:5-8: Unneeded variable: "ret". Return "- ENOMEM" on line 2300 kernel test robot
2021-03-20 5:22 ` [PATCH] printk: fix returnvar.cocci warnings kernel test robot
2021-07-08 15:16 [linux-rt-devel:linux-5.13.y-rt-rebase 11/222] kernel/printk/printk.c:2189:5-8: Unneeded variable: "ret". Return "- ENOMEM" on line 2294 kernel test robot
2021-07-08 15:17 ` [PATCH] printk: fix returnvar.cocci warnings kernel test robot
2021-07-08 15:17 ` kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201101130506.GA6756@4f72a4574d93 \
--to=lkp@intel.com \
--cc=kbuild@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.