]> www.infradead.org Git - users/jedix/linux-maple.git/commit
tracing: Switch trace_stat.c code over to use guard()
authorSteven Rostedt <rostedt@goodmis.org>
Thu, 19 Dec 2024 20:12:12 +0000 (15:12 -0500)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Thu, 26 Dec 2024 15:38:37 +0000 (10:38 -0500)
commit08b767317192e7a20d6d95ff7eca6d9bbc48c192
treeb9e7c201b17c11e89a82284e44333c5cb6a8a6bb
parent6c05353e4ff5875807f1a00f8d95e68b3d1e4d7f
tracing: Switch trace_stat.c code over to use guard()

There are a couple functions in trace_stat.c that have "goto out" or
equivalent on error in order to release locks that were taken. This can be
error prone or just simply make the code more complex.

Switch every location that ends with unlocking a mutex on error over to
using the guard(mutex)() infrastructure to let the compiler worry about
releasing locks. This makes the code easier to read and understand.

Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/20241219201346.870318466@goodmis.org
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
kernel/trace/trace_stat.c