Re: [PATCH] tracing: Remove duplicate warnings
From: Steven Rostedt
Date: Sun Jan 09 2022 - 10:16:17 EST
On Sun, 9 Jan 2022 21:48:58 +0800
Yuntao Wang <ytcoode@xxxxxxxxx> wrote:
> diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
> index 92be9cb1d7d4..d7da46df16c5 100644
> --- a/kernel/trace/trace_events.c
> +++ b/kernel/trace/trace_events.c
> @@ -3462,7 +3462,6 @@ create_event_toplevel_files(struct dentry *parent, struct trace_array *tr)
> entry = trace_create_file("enable", TRACE_MODE_WRITE, d_events,
> tr, &ftrace_tr_enable_fops);
> if (!entry) {
> - pr_warn("Could not create tracefs 'enable' entry\n");
> return -ENOMEM;
> }
If it is becoming a simple condition then you don't need the braces.
if (!entry)
return -ENOMEM;
-- Steve