]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
tracing: Simplify event_enable_func() goto_reg logic
authorSteven Rostedt <rostedt@goodmis.org>
Thu, 19 Dec 2024 20:12:03 +0000 (15:12 -0500)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Thu, 26 Dec 2024 15:38:36 +0000 (10:38 -0500)
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>
kernel/trace/trace_events.c

index 43e9545b5cf31e957f6217d91bf5d02edc855481..86db6ee6f26cbafb75dc5b31d99eefae17c6ad32 100644 (file)
@@ -3799,24 +3799,22 @@ event_enable_func(struct trace_array *tr, struct ftrace_hash *hash,
 
        ret = -ENOMEM;
 
-       if (!param)
-               goto out_reg;
-
-       number = strsep(&param, ":");
+       if (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) {