Re: [PATCH net] net: fec_mpc52xx: Fix resource size format

From: Jakub Kicinski

Date: Wed May 20 2026 - 20:07:21 EST


On Sun, 17 May 2026 21:40:47 -0700 Rosen Penev wrote:
> resource_size() is printed after casting to unsigned long,

This portion is confusing and irrelevant, you're touching the second
arg.

> but sizeof() returns size_t.
>
> Use %zx for the sizeof() value so the format string matches the
> argument type so that 64-bit builds compile.

Not on 64-bit x86 builds apparently. Please provide more details
on which platform and compiler you see a warning and the warning.

> Assisted-by: Codex:GPT-5.5
> Fixes: 31b7720c8259 ("fec: Convert printks to netdev_<level>")

Not a fix.

> Signed-off-by: Rosen Penev <rosenp@xxxxxxxxx>
> ---
> drivers/net/ethernet/freescale/fec_mpc52xx.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/freescale/fec_mpc52xx.c b/drivers/net/ethernet/freescale/fec_mpc52xx.c
> index 556f646073af..a770e7edb1dc 100644
> --- a/drivers/net/ethernet/freescale/fec_mpc52xx.c
> +++ b/drivers/net/ethernet/freescale/fec_mpc52xx.c
> @@ -834,7 +834,7 @@ static int mpc52xx_fec_probe(struct platform_device *op)
> goto err_netdev;
> }
> if (resource_size(&mem) < sizeof(struct mpc52xx_fec)) {
> - pr_err("invalid resource size (%lx < %x), check mpc52xx_devices.c\n",
> + pr_err("invalid resource size (%lx < %zx), check mpc52xx_devices.c\n",
> (unsigned long)resource_size(&mem),
> sizeof(struct mpc52xx_fec));
> rv = -EINVAL;