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

From: Joe Perches

Date: Tue May 19 2026 - 13:38:46 EST


On Sun, 2026-05-17 at 21:40 -0700, Rosen Penev wrote:
> resource_size() is printed after casting to unsigned long, but
> sizeof() returns size_t.

trivia and I wonder if this code path is even possible

> diff --git 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));

mpc52xx_devices.c does not exist.
It was deleted nearly 20 years ago by:

commit 917f0af9e5a9ceecf9e72537fabb501254ba321d
Author: Paul Mackerras <paulus@xxxxxxxxxx>
Date: Mon Jun 9 14:01:46 2008 +1000

and

It's possible to remove the cast to unsigned long and use %pa
and %zx could be %#zx to match output prefixes.