From: Krzysztof Kozlowski <krzk@kernel.org>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: linux-kernel@vger.kernel.org, "Rob Herring" <robh@kernel.org>,
"Saravana Kannan" <saravanak@google.com>,
"Arnd Bergmann" <arnd@kernel.org>,
"Vincent Guittot" <vincent.guittot@linaro.org>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Bill Mills" <bill.mills@linaro.org>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Jason Wang" <jasowang@redhat.com>,
devicetree@vger.kernel.org, virtualization@lists.linux.dev,
"Sudeep Holla" <sudeep.holla@arm.com>,
"Bertrand Marquis" <bertrand.marquis@arm.com>,
"Edgar E . Iglesias" <edgar.iglesias@amd.com>,
"Arnaud Pouliquen" <arnaud.pouliquen@foss.st.com>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>
Subject: Re: [RFC PATCH 2/6] of: reserved-memory: Add of_reserved_mem_lookup_by_name
Date: Wed, 30 Jul 2025 13:24:02 +0200 [thread overview]
Message-ID: <462402ce-22cf-492b-bc40-bd9dbc3a2f16@kernel.org> (raw)
In-Reply-To: <20250730105744.w5arednoluxufvio@vireshk-i7>
On 30/07/2025 12:57, Viresh Kumar wrote:
> On 30-07-25, 11:46, Krzysztof Kozlowski wrote:
>> On 30/07/2025 11:29, Viresh Kumar wrote:
>>> + struct device_node *child __free(device_node) = NULL;
>>
>> This should not be NULL or this should not be cleanup. Follow coding
>> style for cleanup - constructor must be real here.
>
> I may have misunderstood how cleanup works, but this is what I
> thought:
>
> The cleanup is defined in of.h as:
>
> DEFINE_FREE(device_node, struct device_node *, if (_T) of_node_put(_T))
>
>
> Doesn't this mean that it handles the case where `child` is NULL, by
> not calling of_node_put() ? So it should either be a valid constructor
> or NULL and not some stale value.
I am speaking about coding style. It's explicitly requested to use only
the full constructor syntax (see long time Linus' remark or just read
cleanup.h docs).
NULL is allowed in certain cases, but the code here does not look like
needing it in the first place.
Best regards,
Krzysztof
next prev parent reply other threads:[~2025-07-30 11:24 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-30 9:29 [RFC PATCH 0/6] virtio: Add support for Virtio message transport Viresh Kumar
2025-07-30 9:29 ` [RFC PATCH 1/6] of: reserved-memory: Add reserved_mem_device_init() Viresh Kumar
2025-07-30 9:29 ` [RFC PATCH 2/6] of: reserved-memory: Add of_reserved_mem_lookup_by_name Viresh Kumar
2025-07-30 9:46 ` Krzysztof Kozlowski
2025-07-30 10:57 ` Viresh Kumar
2025-07-30 11:24 ` Krzysztof Kozlowski [this message]
2025-08-01 6:02 ` Viresh Kumar
2025-07-30 9:29 ` [RFC PATCH 3/6] virtio: Add support for virtio-msg transport Viresh Kumar
2025-07-30 9:29 ` [RFC PATCH 4/6] virtio-msg: Add optional userspace interface for message I/O Viresh Kumar
2025-07-30 9:29 ` [RFC PATCH 5/6] virtio-msg: Add support for FF-A (Firmware Framework for Arm) bus Viresh Kumar
2025-07-30 9:29 ` [RFC PATCH 6/6] virtio-msg: Add support for loopback bus Viresh Kumar
2025-07-30 9:49 ` Krzysztof Kozlowski
2025-07-30 13:39 ` [RFC PATCH 0/6] virtio: Add support for Virtio message transport Rob Herring
2025-08-12 9:49 ` Viresh Kumar
2025-08-12 13:28 ` Rob Herring
2025-08-13 6:28 ` Viresh Kumar
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=462402ce-22cf-492b-bc40-bd9dbc3a2f16@kernel.org \
--to=krzk@kernel.org \
--cc=alex.bennee@linaro.org \
--cc=arnaud.pouliquen@foss.st.com \
--cc=arnd@kernel.org \
--cc=bertrand.marquis@arm.com \
--cc=bill.mills@linaro.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=edgar.iglesias@amd.com \
--cc=jasowang@redhat.com \
--cc=krzk+dt@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=robh@kernel.org \
--cc=saravanak@google.com \
--cc=sudeep.holla@arm.com \
--cc=vincent.guittot@linaro.org \
--cc=viresh.kumar@linaro.org \
--cc=virtualization@lists.linux.dev \
/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