Re: [PATCH net] net: fec_mpc52xx: Fix resource size format
From: Rosen Penev
Date: Tue May 19 2026 - 17:21:33 EST
On Tue, May 19, 2026 at 10:38 AM Joe Perches <joe@xxxxxxxxxxx> wrote:
>
> 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
Not sure what you mean. probe has a corresponding of_match_table in
the platform_driver struct.
>
> > 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.
right. the message is wrong. this is only meant to be a compilation fix.
> 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.
Yeah I haven't had luck getting cleanups like this merged. Compilation
fix has a higher chance of getting in.