mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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:04:34 -0400	[thread overview]
Message-ID: <20210726110434.4b9f976d@oasis.local.home> (raw)
In-Reply-To: <20210726110237.3c25dbc7@oasis.local.home>

On Mon, 26 Jul 2021 11:02:37 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:

> > @@ -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);

Oh, and if you are making these types of changes, you need to
understand them. The string passed to WARN does not need the "\n" like
the printk() does.

	WARN_ONCE(!ret, "event %d failed to register", event->type);

-- Steve

      reply	other threads:[~2021-07-26 15:08 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
2021-07-26 15:04   ` Steven Rostedt [this message]

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=20210726110434.4b9f976d@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®