lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <42e2d7f6-e3bb-41e8-bf55-46cdb11c713e@lunn.ch>
Date: Wed, 22 Oct 2025 04:00:59 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Jakub Kicinski <kuba@...nel.org>
Cc: Heiner Kallweit <hkallweit1@...il.com>, Wei Fang <wei.fang@....com>,
	Shenwei Wang <shenwei.wang@....com>,
	Clark Wang <xiaoning.wang@....com>,
	Siddharth Vadapalli <s-vadapalli@...com>,
	Roger Quadros <rogerq@...nel.org>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	imx@...ts.linux.dev, linux-omap@...r.kernel.org,
	Andrew Lunn <andrew+netdev@...n.ch>,
	Russell King - ARM Linux <linux@...linux.org.uk>,
	Paolo Abeni <pabeni@...hat.com>, Eric Dumazet <edumazet@...gle.com>,
	David Miller <davem@...emloft.net>
Subject: Re: [PATCH net-next 1/4] net: phy: add iterator phy_for_each

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ