Skip to contentSkip to conversation

tracing: Remove unused ret assignment in tracing_set_tracer()

PATCH New Wayen.Yan 1 participant 1 message Jun 11 Tracing

lore
Share & tools
lore

Wayen.Yan

author
#0 lore raw

PATCH 1/1 tracing: Remove unused ret assignment in tracing_set_tracer()

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.

---
 kernel/trace/trace.c | 1 -
 1 file changed, 1 deletion(-)
kernel/trace/trace.c +0 -1
index 6eb4d3097a..58f81b36b7 100644
@@ -5018,7 +5018,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) {
Signature · 1 line
2.51.0