tracing: Simplify event_enable_func() goto_reg logic

Currently there's an "out_reg:" label that gets jumped to if there's no
parameters to process. Instead, make it a proper "if (param) { }" block as
there's not much to do for the parameter processing, and remove the
"out_reg:" label.

Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/20241219201345.354746196@goodmis.org
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
This commit is contained in:
Steven Rostedt 2024-12-19 15:12:03 -05:00 committed by Steven Rostedt (Google)
parent c949dfb974
commit 4b8d63e5b6

View File

@ -3799,24 +3799,22 @@ event_enable_func(struct trace_array *tr, struct ftrace_hash *hash,
ret = -ENOMEM;
if (!param)
goto out_reg;
if (param) {
number = strsep(&param, ":");
number = strsep(&param, ":");
ret = -EINVAL;
if (!strlen(number))
goto out;
ret = -EINVAL;
if (!strlen(number))
goto out;
/*
* We use the callback data field (which is a pointer)
* as our counter.
*/
ret = kstrtoul(number, 0, &count);
if (ret)
goto out;
}
/*
* We use the callback data field (which is a pointer)
* as our counter.
*/
ret = kstrtoul(number, 0, &count);
if (ret)
goto out;
out_reg:
/* Don't let event modules unload while probe registered */
ret = trace_event_try_get_ref(file->event_call);
if (!ret) {