Thread (11 messages) 11 messages, 3 authors, 18d ago

Re: [PATCH] tracing: Cleanup event_enable_trigger_parse() by using __free()

From: Steven Rostedt <rostedt@goodmis.org>
Date: 2026-07-03 15:42:36
Also in: kernel-janitors, lkml

On Fri, 3 Jul 2026 07:00:10 +0200
Markus Elfring [off-list ref] wrote:
quoted
No, it's fine as is.  
Does this feedback mean that you disagree to an essential development requirement
according to such a programming interface?
https://elixir.bootlin.com/linux/v7.1.2/source/include/linux/cleanup.h#L142-L153
 * Given that the "__free(...) = NULL" pattern for variables defined at
 * the top of the function poses this potential interdependency problem
 * the recommendation is to always define and assign variables in one
 * statement and not group variable definitions at the top of the
 * function when __free() is used.
This is really just a guideline.
 *
 * Lastly, given that the benefit of cleanup helpers is removal of
 * "goto", and that the "goto" statement can jump between scopes, the
 * expectation is that usage of "goto" and cleanup helpers is never
 * mixed in the same function. I.e. for a given routine, convert all
 * resources that need a "goto" cleanup to scope-based cleanup, or
 * convert none of them.
The above has more to do with guard()s and not so much with a __free() at
the top of the function. The reason is because things get broken if a goto
jumps over a guard().

In other words, if you don't know what you are doing, don't mix them.

-- Steve
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help