[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <462402ce-22cf-492b-bc40-bd9dbc3a2f16@kernel.org>
Date: Wed, 30 Jul 2025 13:24:02 +0200
From: Krzysztof Kozlowski <krzk@...nel.org>
To: Viresh Kumar <viresh.kumar@...aro.org>
Cc: linux-kernel@...r.kernel.org, Rob Herring <robh@...nel.org>,
Saravana Kannan <saravanak@...gle.com>, Arnd Bergmann <arnd@...nel.org>,
Vincent Guittot <vincent.guittot@...aro.org>,
Alex Bennée <alex.bennee@...aro.org>,
Bill Mills <bill.mills@...aro.org>, "Michael S. Tsirkin" <mst@...hat.com>,
Jason Wang <jasowang@...hat.com>, devicetree@...r.kernel.org,
virtualization@...ts.linux.dev, Sudeep Holla <sudeep.holla@....com>,
Bertrand Marquis <bertrand.marquis@....com>,
"Edgar E . Iglesias" <edgar.iglesias@....com>,
Arnaud Pouliquen <arnaud.pouliquen@...s.st.com>,
Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>
Subject: Re: [RFC PATCH 2/6] of: reserved-memory: Add
of_reserved_mem_lookup_by_name
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
Powered by blists - more mailing lists