From: Steven Rostedt <rostedt@goodmis.org>
To: Markus Elfring <Markus.Elfring@web.de>
Cc: linux-trace-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org,
Masami Hiramatsu <mhiramat@kernel.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] tracing: Cleanup event_enable_trigger_parse() by using __free()
Date: Fri, 3 Jul 2026 11:42:32 -0400 [thread overview]
Message-ID: <20260703114233.56f0c864@gandalf.local.home> (raw)
In-Reply-To: <d8f33e0a-b378-4dad-92b1-9ce2098c04f3@web.de>
On Fri, 3 Jul 2026 07:00:10 +0200
Markus Elfring <Markus.Elfring@web.de> wrote:
> > 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
next prev parent reply other threads:[~2026-07-03 15:42 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-01 21:48 [PATCH] tracing: Cleanup event_enable_trigger_parse() by using __free() Steven Rostedt
2026-07-01 22:41 ` Masami Hiramatsu
2026-07-02 9:58 ` Markus Elfring
2026-07-02 20:53 ` Steven Rostedt
2026-07-03 5:00 ` Markus Elfring
2026-07-03 15:42 ` Steven Rostedt [this message]
2026-07-03 18:37 ` Markus Elfring
2026-07-03 19:09 ` Steven Rostedt
2026-07-03 19:20 ` Markus Elfring
2026-07-03 19:33 ` Steven Rostedt
2026-07-02 11:58 ` [PATCH] " Markus Elfring
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260703114233.56f0c864@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=Markus.Elfring@web.de \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox