[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20240823082951.37d6ea70@gandalf.local.home>
Date: Fri, 23 Aug 2024 08:29:51 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Hongbo Li <lihongbo22@...wei.com>
Cc: <mhiramat@...nel.org>, <mathieu.desnoyers@...icios.com>,
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH -next] kernel/trace: Replace printk and WARN_ON by WARN
On Fri, 23 Aug 2024 17:18:03 +0800
Hongbo Li <lihongbo22@...wei.com> wrote:
> 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.
Following the advice of robots causes the brain to stop functioning.
>
> 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");
You completely IGNORED and then REMOVED the comment!!!!
Notice that it's not even a KERN_WARN, it's a KERN_CONT.
BIG NACK!
-- Steve
> return -1;
> }
> /* Only reset on passing, to avoid touching corrupted buffers */
Powered by blists - more mailing lists