]> exis.tech > repos - linux.git/commitdiff
tracing: Remove unused ret assignment in tracing_set_tracer()
authorWayen.Yan <win847@gmail.com>
Thu, 11 Jun 2026 03:52:57 +0000 (11:52 +0800)
committerSteven Rostedt <rostedt@goodmis.org>
Mon, 6 Jul 2026 19:00:01 +0000 (15:00 -0400)
In tracing_set_tracer(), the assignment 'ret = 0' following the
__tracing_resize_ring_buffer() error check is a dead store. After
this point, all subsequent code paths either return with a constant
value (-EINVAL, 0, -EBUSY) or reassign ret before reading it
(tracing_arm_snapshot_locked, tracer_init).

Remove the unnecessary assignment.

No functional change.

Link: https://patch.msgid.link/6a2a37c4.f0a9eb5a.2fc603.7724@mx.google.com
Signed-off-by: Wayen.Yan <win847@gmail.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
kernel/trace/trace.c

index 1146b83b711a2bfa724ba08def7e19f6c4425790..299f5ab630b938ce8fda21546cbcdbf1464785cf 100644 (file)
@@ -5015,7 +5015,6 @@ int tracing_set_tracer(struct trace_array *tr, const char *buf)
                                                RING_BUFFER_ALL_CPUS);
                if (ret < 0)
                        return ret;
-               ret = 0;
        }
 
        list_for_each_entry(t, &tr->tracers, list) {