From: Andrew Lunn <andrew@lunn.ch>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Heiner Kallweit <hkallweit1@gmail.com>,
Wei Fang <wei.fang@nxp.com>, Shenwei Wang <shenwei.wang@nxp.com>,
Clark Wang <xiaoning.wang@nxp.com>,
Siddharth Vadapalli <s-vadapalli@ti.com>,
Roger Quadros <rogerq@kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
imx@lists.linux.dev, linux-omap@vger.kernel.org,
Andrew Lunn <andrew+netdev@lunn.ch>,
Russell King - ARM Linux <linux@armlinux.org.uk>,
Paolo Abeni <pabeni@redhat.com>,
Eric Dumazet <edumazet@google.com>,
David Miller <davem@davemloft.net>
Subject: Re: [PATCH net-next 1/4] net: phy: add iterator phy_for_each
Date: Wed, 22 Oct 2025 04:00:59 +0200 [thread overview]
Message-ID: <42e2d7f6-e3bb-41e8-bf55-46cdb11c713e@lunn.ch> (raw)
In-Reply-To: <20251021182451.33de59e8@kernel.org>
On Tue, Oct 21, 2025 at 06:24:51PM -0700, Jakub Kicinski wrote:
> On Fri, 17 Oct 2025 22:41:12 +0200 Heiner Kallweit wrote:
> > +#define phy_for_each(_bus, _phydev) \
> > + for (_phydev = phy_find_first(_bus); _phydev; \
> > + _phydev = phy_find_next(_bus, _phydev))
>
> Wouldn't this better be called mii_for_each_phy() or
> mii_bus_for_each_phy() ?
>
> To an outsider and with PHY typologies it may not be
> sufficiently obvious that this helper is used to iterate
> a all addresses on a MII bus.
The naming scheme suggest it either needs to start with phy_ or
mdiobus_.
mdiobus_for_each_phy() might be the best name, if you want to indicate
it iterates an mdio bus. It should also be noted that it will ignore
devices on the bus which are not PHYs. So we need phy in the name
somewhere.
Andrew
next prev parent reply other threads:[~2025-10-22 2:01 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-17 20:39 [PATCH net-next 0/4] net: phy: add iterator phy_for_each Heiner Kallweit
2025-10-17 20:41 ` [PATCH net-next 1/4] " Heiner Kallweit
2025-10-17 20:51 ` Gerhard Engleder
2025-10-22 1:24 ` Jakub Kicinski
2025-10-22 2:00 ` Andrew Lunn [this message]
2025-10-17 20:41 ` [PATCH net-next 2/4] net: fec: use new " Heiner Kallweit
2025-10-17 20:51 ` Gerhard Engleder
2025-10-17 20:42 ` [PATCH net-next 3/4] net: davinci_mdio: " Heiner Kallweit
2025-10-17 20:51 ` Gerhard Engleder
2025-10-17 20:43 ` [PATCH net-next 4/4] net: phy: use new iterator phy_for_each in mdiobus_prevent_c45_scan Heiner Kallweit
2025-10-17 20:52 ` Gerhard Engleder
2025-10-20 2:44 ` [PATCH net-next 0/4] net: phy: add iterator phy_for_each Wei Fang
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=42e2d7f6-e3bb-41e8-bf55-46cdb11c713e@lunn.ch \
--to=andrew@lunn.ch \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=imx@lists.linux.dev \
--cc=kuba@kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rogerq@kernel.org \
--cc=s-vadapalli@ti.com \
--cc=shenwei.wang@nxp.com \
--cc=wei.fang@nxp.com \
--cc=xiaoning.wang@nxp.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