Thread (6 messages) 6 messages, 3 authors, 24d ago

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

From: Rosen Penev <hidden>
Date: 2026-05-19 21:20:51
Also in: lkml

On Tue, May 19, 2026 at 10:38 AM Joe Perches [off-list ref] wrote:
On Sun, 2026-05-17 at 21:40 -0700, Rosen Penev wrote:
quoted
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.
quoted
diff --git a/drivers/net/ethernet/freescale/fec_mpc52xx.c b/drivers/net/ethernet/freescale/fec_mpc52xx.c
[]
quoted
@@ -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 [off-list ref]
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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help