diff mbox series

[05/14] tracing: Simplify event_enable_func() goto_reg logic

Message ID 20241219201345.354746196@goodmis.org (mailing list archive)
State New
Headers show
Series tracing: Convert over to guard() and __free() infrastructure | expand

Commit Message

Steven Rostedt Dec. 19, 2024, 8:12 p.m. UTC
From: Steven Rostedt <rostedt@goodmis.org>

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.

Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
 kernel/trace/trace_events.c | 28 +++++++++++++---------------
 1 file changed, 13 insertions(+), 15 deletions(-)
diff mbox series

Patch

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(&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) {