]> www.infradead.org Git - users/dwmw2/linux.git/commit
ftrace: Switch ftrace.c code over to use guard()
authorSteven Rostedt <rostedt@goodmis.org>
Mon, 23 Dec 2024 18:46:22 +0000 (13:46 -0500)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Tue, 24 Dec 2024 02:01:48 +0000 (21:01 -0500)
commit1d95fd9d6b1a1750da2dec1485a4c58f5a7d3ebd
treeaba669b4a99832aca30fa3e3928b441a767cec7c
parent77e53cb2fcf2c5e81f06f4a41783d8752cf9d038
ftrace: Switch ftrace.c code over to use guard()

There are a few functions in ftrace.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>
Link: https://lore.kernel.org/20241223184941.718001540@goodmis.org
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
kernel/trace/ftrace.c