[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240828111045.11dfc157@kernel.org>
Date: Wed, 28 Aug 2024 11:10:45 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Krzysztof Kozlowski <krzk@...nel.org>
Cc: Andrew Lunn <andrew@...n.ch>, Jinjie Ruan <ruanjinjie@...wei.com>,
woojung.huh@...rochip.com, f.fainelli@...il.com, olteanv@...il.com,
davem@...emloft.net, edumazet@...gle.com, pabeni@...hat.com,
linus.walleij@...aro.org, alsi@...g-olufsen.dk, justin.chen@...adcom.com,
sebastian.hesselbarth@...il.com, alexandre.torgue@...s.st.com,
joabreu@...opsys.com, mcoquelin.stm32@...il.com, wens@...e.org,
jernej.skrabec@...il.com, samuel@...lland.org, hkallweit1@...il.com,
linux@...linux.org.uk, ansuelsmth@...il.com, UNGLinuxDriver@...rochip.com,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
bcm-kernel-feedback-list@...adcom.com,
linux-arm-kernel@...ts.infradead.org, linux-sunxi@...ts.linux.dev,
linux-stm32@...md-mailman.stormreply.com, jic23@...nel.org
Subject: Re: [PATCH net-next v2 00/13] net: Simplified with scoped function
On Wed, 28 Aug 2024 16:45:32 +0200 Krzysztof Kozlowski wrote:
> On 28/08/2024 16:32, Andrew Lunn wrote:
> > On Wed, Aug 28, 2024 at 11:23:30AM +0800, Jinjie Ruan wrote:
> >> Simplify with scoped for each OF child loop and __free(), as well as
> >> dev_err_probe().
> >>
> >> Changes in v2:
> >> - Subject prefix: next -> net-next.
> >> - Split __free() from scoped for each OF child loop clean.
> >> - Fix use of_node_put() instead of __free() for the 5th patch.
> >
> > I personally think all these __free() are ugly and magical. Can it
>
> It is code readability so quite subjective. Jakub also rejected one of
> such __free() changes, so maybe all these cases here should be rejected?
Andrew's comments on refcounting on DT objects notwithstanding --
I do like the _scoped() iterator quite a bit, FWIW. I think it's one
of the better uses of the auto-cleanup and local variable declarations.
Direct uses of __free() are more questionable in my opinion.
Using advanced constructs to build clean subsystem APIs is great,
sprinkling unreadable constructs to save LoC is what C++ is for.
(Lets see how many people this offends ;))
Powered by blists - more mailing lists