lkml.org 
[lkml]   [2021]   [Jul]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] tracing: use WARN_ONCE
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

\
 
 \ /
  Last update: 2021-07-26 17:09    [W:0.032 / U:26.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site