Re: [PATCH net v3 1/2] net: phy: Introduce PHY_ID_SIZE — minimum size for PHY ID string

From: Andy Shevchenko
Date: Mon Mar 24 2025 - 11:57:21 EST


On Mon, Mar 24, 2025 at 03:06:22PM +0000, Russell King (Oracle) wrote:
> On Mon, Mar 24, 2025 at 04:39:29PM +0200, Andy Shevchenko wrote:
> > The PHY_ID_FMT defines the format specifier "%s:%02x" to form
> > the PHY ID string, where the maximum of the first part is defined
> > in MII_BUS_ID_SIZE, including NUL terminator, and the second part
> > is implied to be 3 as the maximum address is limited to 32, meaning
> > that 2 hex digits is more than enough, plus ':' (colon) delimiter.
> > However, some drivers, which are using PHY_ID_FMT, customise buffer
> > size and do that incorrectly. Introduce a new constant PHY_ID_SIZE
> > that makes the minimum required size explicit, so drivers are
> > encouraged to use it.
> >
> > Suggested-by: "Russell King (Oracle)" <linux@xxxxxxxxxxxxxxx>
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
>
> Reviewed-by: Russell King (Oracle) <rmk+kernel@xxxxxxxxxxxxxxx>
>
> Thanks!

Thank you!

And just a bit of offtopic, can you look at
20250312194921.103004-1-andriy.shevchenko@xxxxxxxxxxxxxxx
and comment / apply?

That is one of the only few obstacles for me (and perhaps others, like CIs)
to enable CONFIG_WERROR when build with `make W=1` (implying existing defconfigs
for x86).

--
With Best Regards,
Andy Shevchenko