[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1638881732-3157-1-git-send-email-wangqing@vivo.com>
Date: Tue, 7 Dec 2021 04:55:32 -0800
From: Qing Wang <wangqing@...o.com>
To: Steven Rostedt <rostedt@...dmis.org>,
Ingo Molnar <mingo@...hat.com>, linux-kernel@...r.kernel.org
Cc: Wang Qing <wangqing@...o.com>
Subject: [PATCH] trace: use WARN instead of printk and WARN_ON
From: Wang Qing <wangqing@...o.com>
Simply use WARN instead of printk(KERN_WARNING, ...) and WARN_ON.
Signed-off-by: Wang Qing <wangqing@...o.com>
---
kernel/trace/trace_output.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c
index 3547e71..e0348ec
--- a/kernel/trace/trace_output.c
+++ b/kernel/trace/trace_output.c
@@ -775,8 +775,7 @@ int register_trace_event(struct trace_event *event)
list_add_tail(&event->list, list);
} else if (event->type > __TRACE_LAST_TYPE) {
- printk(KERN_WARNING "Need to add type to trace.h\n");
- WARN_ON(1);
+ WARN(1, "Need to add type to trace.h\n");
goto out;
} else {
/* Is this event already used */
@@ -1569,11 +1568,9 @@ __init static int init_events(void)
event = events[i];
ret = register_trace_event(event);
- if (!ret) {
- printk(KERN_WARNING "event %d failed to register\n",
- event->type);
- WARN_ON_ONCE(1);
- }
+ if (!ret)
+ WARN_ONCE(1, "event %d failed to register\n",
+ event->type);
}
return 0;
--
2.7.4
Powered by blists - more mailing lists