From: Steven Rostedt <rostedt@goodmis.org>
To: Jason Wang <wangborong@cdjrlc.com>
Cc: mingo@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tracing: use WARN_ONCE
Date: Mon, 26 Jul 2021 11:02:37 -0400 [thread overview]
Message-ID: <20210726110237.3c25dbc7@oasis.local.home> (raw)
In-Reply-To: <20210726135635.143285-1-wangborong@cdjrlc.com>
On Mon, 26 Jul 2021 21:56:35 +0800
Jason Wang <wangborong@cdjrlc.com> wrote:
> printk + WARN_ON_ONCE can be just WARN_ONCE.
>
> Signed-off-by: Jason Wang <wangborong@cdjrlc.com>
> ---
> kernel/trace/trace_output.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c
> index a0bf446bb034..c06726b6d8b4 100644
> --- a/kernel/trace/trace_output.c
> +++ b/kernel/trace/trace_output.c
> @@ -1574,9 +1574,8 @@ __init static int init_events(void)
>
> ret = register_trace_event(event);
> if (!ret) {
> - printk(KERN_WARNING "event %d failed to register\n",
> - event->type);
> - WARN_ON_ONCE(1);
> + WARN_ONCE(1, "event %d failed to register\n",
> + event->type);
> }
> }
>
If you're going to change this, then nuke the conditional!
WARN_ONCE(!ret, "event %d failed to register\n", event->type);
-- Steve
next prev parent reply other threads:[~2021-07-26 15:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-26 13:56 Jason Wang
2021-07-26 15:02 ` Steven Rostedt [this message]
2021-07-26 15:04 ` Steven Rostedt
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=20210726110237.3c25dbc7@oasis.local.home \
--to=rostedt@goodmis.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=wangborong@cdjrlc.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®