From: Andrew Lunn <andrew@lunn.ch>
To: Krzysztof Kozlowski <krzk@kernel.org>
Cc: Jinjie Ruan <ruanjinjie@huawei.com>,
woojung.huh@microchip.com, f.fainelli@gmail.com,
olteanv@gmail.com, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com, linus.walleij@linaro.org,
alsi@bang-olufsen.dk, justin.chen@broadcom.com,
sebastian.hesselbarth@gmail.com, alexandre.torgue@foss.st.com,
joabreu@synopsys.com, mcoquelin.stm32@gmail.com, wens@csie.org,
jernej.skrabec@gmail.com, samuel@sholland.org,
hkallweit1@gmail.com, linux@armlinux.org.uk,
ansuelsmth@gmail.com, UNGLinuxDriver@microchip.com,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
bcm-kernel-feedback-list@broadcom.com,
linux-arm-kernel@lists.infradead.org,
linux-sunxi@lists.linux.dev,
linux-stm32@st-md-mailman.stormreply.com, jic23@kernel.org
Subject: Re: [PATCH net-next v2 00/13] net: Simplified with scoped function
Date: Wed, 28 Aug 2024 17:24:52 +0200 [thread overview]
Message-ID: <6d88b103-ba8a-4631-bbf5-b9046b9b82cd@lunn.ch> (raw)
In-Reply-To: <71deb322-4b54-4c1c-a665-d9de84ea9baf@kernel.org>
On Wed, Aug 28, 2024 at 04:45:32PM +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.
Try.
But the __ is also a red flag. Anything starting with _ or __ in
general should not be used in common code. That prefix is supposed to
indicate it is internal plumbing which should be hidden away, out of
sight, not to be used directly. Yet here it is, being scattered
everywhere.
I also wounder if this is lipstick on a pig. I suspect the reference
counting on DT object is broken everywhere, because it is almost never
used. In general, DT blobs exist from boot to shutdown. They don't go
away, so these reference counts are never used. DT overlays do exist,
but account for what, 1% of DT objects? And how often does an overlay
actually get unloaded? Has anybody written a fuzzer to try unloading
parts of DT blobs? I suspect we would quickly drown in bug reports.
Adding missing of_node_put() seems to be high on the list of bot
driven patches, which cause a lot of maintainer effort for no real
gain. And those submitting the patches probably have little
understanding of what they are doing, other than making the bot happy.
Do we really want to be adding ugly code, probably with a few
additional bugs thrown in, just to make a bot happy, but probably no
real benefit?
Andrew
next prev parent reply other threads:[~2024-08-28 15:25 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-28 3:23 [PATCH net-next v2 00/13] net: Simplified with scoped function Jinjie Ruan
2024-08-28 3:23 ` [PATCH net-next v2 01/13] net: stmmac: dwmac-sun8i: Use for_each_child_of_node_scoped() Jinjie Ruan
2024-08-28 12:38 ` Jonathan Cameron
2024-08-28 14:17 ` Andrew Lunn
2024-08-29 2:29 ` Jinjie Ruan
2024-08-28 3:23 ` [PATCH net-next v2 02/13] net: stmmac: dwmac-sun8i: Use __free() to simplify code Jinjie Ruan
2024-08-28 12:38 ` Jonathan Cameron
2024-08-28 3:23 ` [PATCH net-next v2 03/13] net: dsa: realtek: Use for_each_child_of_node_scoped() Jinjie Ruan
2024-08-28 12:39 ` Jonathan Cameron
2024-08-28 3:23 ` [PATCH net-next v2 04/13] net: dsa: realtek: Use __free() to simplify code Jinjie Ruan
2024-08-28 12:37 ` Jonathan Cameron
2024-08-28 3:23 ` [PATCH net-next v2 05/13] net: phy: Fix missing of_node_put() for leds Jinjie Ruan
2024-08-28 12:40 ` Jonathan Cameron
2024-08-28 15:45 ` Willem de Bruijn
2024-08-29 2:46 ` Jinjie Ruan
2024-08-29 2:52 ` Jinjie Ruan
2024-08-28 3:23 ` [PATCH net-next v2 06/13] net: phy: Use for_each_available_child_of_node_scoped() Jinjie Ruan
2024-08-28 12:44 ` Jonathan Cameron
2024-08-28 3:23 ` [PATCH net-next v2 07/13] net: mdio: mux-mmioreg: Simplified with scoped function Jinjie Ruan
2024-08-28 12:46 ` Jonathan Cameron
2024-08-28 3:23 ` [PATCH net-next v2 08/13] net: mdio: mux-mmioreg: Simplified with dev_err_probe() Jinjie Ruan
2024-08-28 12:48 ` Jonathan Cameron
2024-08-29 3:11 ` Jinjie Ruan
2024-08-29 12:38 ` Andrew Lunn
2024-08-28 3:23 ` [PATCH net-next v2 09/13] net: mv643xx_eth: Simplify with scoped for each OF child loop Jinjie Ruan
2024-08-28 12:49 ` Jonathan Cameron
2024-08-28 3:23 ` [PATCH net-next v2 10/13] net: dsa: microchip: Use scoped function to simplfy code Jinjie Ruan
2024-08-28 12:50 ` Jonathan Cameron
2024-08-28 3:23 ` [PATCH net-next v2 11/13] net: dsa: microchip: Use __free() " Jinjie Ruan
2024-08-28 12:50 ` Jonathan Cameron
2024-08-28 3:23 ` [PATCH net-next v2 12/13] net: bcmasp: Simplify with scoped for each OF child loop Jinjie Ruan
2024-08-28 12:51 ` Jonathan Cameron
2024-08-28 3:23 ` [PATCH net-next v2 13/13] net: bcmasp: Simplify with __free() Jinjie Ruan
2024-08-28 12:53 ` Jonathan Cameron
2024-08-28 14:32 ` [PATCH net-next v2 00/13] net: Simplified with scoped function Andrew Lunn
2024-08-28 14:45 ` Krzysztof Kozlowski
2024-08-28 15:24 ` Andrew Lunn [this message]
2024-08-28 18:10 ` Jakub Kicinski
2024-08-29 3:26 ` Jinjie Ruan
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=6d88b103-ba8a-4631-bbf5-b9046b9b82cd@lunn.ch \
--to=andrew@lunn.ch \
--cc=UNGLinuxDriver@microchip.com \
--cc=alexandre.torgue@foss.st.com \
--cc=alsi@bang-olufsen.dk \
--cc=ansuelsmth@gmail.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.com \
--cc=hkallweit1@gmail.com \
--cc=jernej.skrabec@gmail.com \
--cc=jic23@kernel.org \
--cc=joabreu@synopsys.com \
--cc=justin.chen@broadcom.com \
--cc=krzk@kernel.org \
--cc=kuba@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=linux-sunxi@lists.linux.dev \
--cc=linux@armlinux.org.uk \
--cc=mcoquelin.stm32@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=ruanjinjie@huawei.com \
--cc=samuel@sholland.org \
--cc=sebastian.hesselbarth@gmail.com \
--cc=wens@csie.org \
--cc=woojung.huh@microchip.com \
/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