]> Gentwo Git Trees - linux/.git/commit
tracing: Use switch statement instead of ifs in set_tracer_flag()
authorSteven Rostedt <rostedt@goodmis.org>
Thu, 6 Nov 2025 00:33:26 +0000 (19:33 -0500)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Mon, 10 Nov 2025 19:33:51 +0000 (14:33 -0500)
commit3a0d5bc76ff482c6e0c20f66f2b32e5dcf8238fe
tree18c1ebbb07e1e2233f5893345ba5d99bace6e722
parent9c5053083eeecc7a2cd6c1271a85087e73820ae2
tracing: Use switch statement instead of ifs in set_tracer_flag()

The "mask" passed in to set_trace_flag() has a single bit set. The
function then checks if the mask is equal to one of the option masks and
performs the appropriate function associated to that option.

Instead of having a bunch of "if ()" statement, use a "switch ()"
statement instead to make it cleaner and a bit more optimal.

No function changes.

Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Link: https://patch.msgid.link/20251106003501.890298562@kernel.org
Reviewed-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
kernel/trace/trace.c