[for-next][PATCH 05/15] tracing: Simplify event_enable_func() goto_reg logic
From: Steven Rostedt
Date: Thu Dec 26 2024 - 09:40:01 EST
From: Steven Rostedt <rostedt@xxxxxxxxxxx>
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@xxxxxxxxxx>
Cc: Mark Rutland <mark.rutland@xxxxxxx>
Cc: Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxxxx>
Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Link: https://lore.kernel.org/20241219201345.354746196@xxxxxxxxxxx
Signed-off-by: Steven Rostedt (Google) <rostedt@xxxxxxxxxxx>
---
kernel/trace/trace_events.c | 28 +++++++++++++---------------
1 file changed, 13 insertions(+), 15 deletions(-)
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index 43e9545b5cf3..86db6ee6f26c 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -3799,24 +3799,22 @@ event_enable_func(struct trace_array *tr, struct ftrace_hash *hash,
ret = -ENOMEM;
- if (!param)
- goto out_reg;
-
- number = strsep(¶m, ":");
+ if (param) {
+ number = strsep(¶m, ":");
- 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) {
--
2.45.2