[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240823091803.2953933-1-lihongbo22@huawei.com>
Date: Fri, 23 Aug 2024 17:18:03 +0800
From: Hongbo Li <lihongbo22@...wei.com>
To: <rostedt@...dmis.org>, <mhiramat@...nel.org>,
<mathieu.desnoyers@...icios.com>
CC: <lihongbo22@...wei.com>, <linux-kernel@...r.kernel.org>
Subject: [PATCH -next] kernel/trace: Replace printk and WARN_ON by WARN
Use WARN instead of printk + WARN_ON as reported from coccinelle:
SUGGESTION: printk + WARN_ON can be just WARN
Let's fix it and simplify the code.
Signed-off-by: Hongbo Li <lihongbo22@...wei.com>
---
kernel/trace/trace.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 833e7d654325..5f385c55499f 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -2138,9 +2138,7 @@ static int run_tracer_selftest(struct tracer *type)
/* the test is responsible for resetting too */
tr->current_trace = saved_tracer;
if (ret) {
- printk(KERN_CONT "FAILED!\n");
- /* Add the warning after printing 'FAILED' */
- WARN_ON(1);
+ WARN(1, "FAILED!\n");
return -1;
}
/* Only reset on passing, to avoid touching corrupted buffers */
--
2.34.1
Powered by blists - more mailing lists