Skip to content

Commit 4b8d63e

Browse files
committed
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 <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Mathieu Desnoyers <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: https://lore.kernel.org/[email protected] Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent c949dfb commit 4b8d63e

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

kernel/trace/trace_events.c

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3799,24 +3799,22 @@ event_enable_func(struct trace_array *tr, struct ftrace_hash *hash,
37993799

38003800
ret = -ENOMEM;
38013801

3802-
if (!param)
3803-
goto out_reg;
3804-
3805-
number = strsep(&param, ":");
3802+
if (param) {
3803+
number = strsep(&param, ":");
38063804

3807-
ret = -EINVAL;
3808-
if (!strlen(number))
3809-
goto out;
3805+
ret = -EINVAL;
3806+
if (!strlen(number))
3807+
goto out;
38103808

3811-
/*
3812-
* We use the callback data field (which is a pointer)
3813-
* as our counter.
3814-
*/
3815-
ret = kstrtoul(number, 0, &count);
3816-
if (ret)
3817-
goto out;
3809+
/*
3810+
* We use the callback data field (which is a pointer)
3811+
* as our counter.
3812+
*/
3813+
ret = kstrtoul(number, 0, &count);
3814+
if (ret)
3815+
goto out;
3816+
}
38183817

3819-
out_reg:
38203818
/* Don't let event modules unload while probe registered */
38213819
ret = trace_event_try_get_ref(file->event_call);
38223820
if (!ret) {

0 commit comments

Comments
 (0)