From: Nam Cao <namcao@linutronix.de>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Gabriele Monaco <gmonaco@redhat.com>,
Masami Hiramatsu <mhiramat@kernel.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] rv: Convert to use __free
Date: Mon, 17 Nov 2025 16:20:23 +0100 [thread overview]
Message-ID: <87o6p0heiw.fsf@yellow.woof> (raw)
In-Reply-To: <20251117100735.71466d12@gandalf.local.home>
Steven Rostedt <rostedt@goodmis.org> writes:
> On Sun, 16 Nov 2025 15:35:12 +0000
> Nam Cao <namcao@linutronix.de> wrote:
>> + mon->root_d = dir;
>> + retain_and_null_ptr(dir);
>> return 0;
>
> Why the "retain_and_null_ptr() and not just:
>
> mon->root-d = no_free_ptr(dir);
> return 0;
>
> As from my understanding is that the retain_and_null_ptr() is for use of
> passing the variable to a function that will consume it. But for assigning
> to a variable, I usually just use the no_free_ptr().
I wasn't aware that no_free_ptr() exists. Gabriele has pointed this out,
and I fixed it up in v2.
Nam
prev parent reply other threads:[~2025-11-17 15:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-16 15:35 [PATCH 0/2] rv: Tidy up with auto-cleanup Nam Cao
2025-11-16 15:35 ` [PATCH 1/2] rv: Convert to use lock guard Nam Cao
2025-11-16 15:35 ` [PATCH 2/2] rv: Convert to use __free Nam Cao
2025-11-17 7:27 ` Gabriele Monaco
2025-11-17 8:30 ` Nam Cao
2025-11-17 15:07 ` Steven Rostedt
2025-11-17 15:20 ` Nam Cao [this message]
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=87o6p0heiw.fsf@yellow.woof \
--to=namcao@linutronix.de \
--cc=gmonaco@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=rostedt@goodmis.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