* [PATCH] tracing: Use WARN(1,...)
@ 2021-02-26 9:44 Xu Wang
2021-02-26 14:40 ` Steven Rostedt
0 siblings, 1 reply; 2+ messages in thread
From: Xu Wang @ 2021-02-26 9:44 UTC (permalink / raw)
To: rostedt, mingo; +Cc: linux-kernel
Use WARN(1,...) rather than printk followed by WARN_ON(1).
Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
---
kernel/trace/trace.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 526fd5ac2ba8..a556b8c00a9f 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -1957,7 +1957,7 @@ static int run_tracer_selftest(struct tracer *type)
tr->current_trace = saved_tracer;
if (ret) {
/* Add the warning after printing 'FAILED' */
- WARN(1, KERN_CONT "FAILED!\n");
+ WARN(1, "FAILED!\n");
return -1;
}
/* Only reset on passing, to avoid touching corrupted buffers */
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] tracing: Use WARN(1,...)
2021-02-26 9:44 [PATCH] tracing: Use WARN(1,...) Xu Wang
@ 2021-02-26 14:40 ` Steven Rostedt
0 siblings, 0 replies; 2+ messages in thread
From: Steven Rostedt @ 2021-02-26 14:40 UTC (permalink / raw)
To: Xu Wang; +Cc: mingo, linux-kernel
On Fri, 26 Feb 2021 09:44:26 +0000
Xu Wang <vulab@iscas.ac.cn> wrote:
> Use WARN(1,...) rather than printk followed by WARN_ON(1).
Why?
>
> Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
> ---
> kernel/trace/trace.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
> index 526fd5ac2ba8..a556b8c00a9f 100644
> --- a/kernel/trace/trace.c
> +++ b/kernel/trace/trace.c
> @@ -1957,7 +1957,7 @@ static int run_tracer_selftest(struct tracer *type)
> tr->current_trace = saved_tracer;
> if (ret) {
> /* Add the warning after printing 'FAILED' */
> - WARN(1, KERN_CONT "FAILED!\n");
> + WARN(1, "FAILED!\n");
The above isn't even in my tree.
Anyway, look at the code around it, and then tell that this patch makes
sense.
NAK.
-- Steve
> return -1;
> }
> /* Only reset on passing, to avoid touching corrupted buffers */
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-02-26 14:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-26 9:44 [PATCH] tracing: Use WARN(1,...) Xu Wang
2021-02-26 14:40 ` Steven Rostedt
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.