Re: [PATCH net v2 1/2] net: phy: Fix formatting specifier to avoid potential string cuts

From: Russell King (Oracle)
Date: Wed Mar 19 2025 - 11:53:43 EST


On Wed, Mar 19, 2025 at 12:54:33PM +0200, Andy Shevchenko wrote:
> -#define PHY_ID_FMT "%s:%02x"
> +#define PHY_ID_FMT "%s:%02hhx"

I was going to state whether it is correct to use hh with an "int"
argument, as printf() suggests its only for use with arguments of
type 'signed char' and 'unsigned char'. My suspicion has been
confirmed by the warning the kbuild bot has just reported.

It seems this is not a correct fix for the problem you report.

--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!