* [PATCH net] net: fec_mpc52xx: Fix resource size format
@ 2026-05-18 4:40 Rosen Penev
2026-05-19 17:37 ` Joe Perches
2026-05-21 0:06 ` Jakub Kicinski
0 siblings, 2 replies; 6+ messages in thread
From: Rosen Penev @ 2026-05-18 4:40 UTC (permalink / raw)
To: netdev
Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Joe Perches, open list
resource_size() is printed after casting to unsigned long, 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.
Assisted-by: Codex:GPT-5.5
Fixes: 31b7720c8259 ("fec: Convert printks to netdev_<level>")
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
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;
--
2.54.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH net] net: fec_mpc52xx: Fix resource size format
2026-05-18 4:40 [PATCH net] net: fec_mpc52xx: Fix resource size format Rosen Penev
@ 2026-05-19 17:37 ` Joe Perches
2026-05-19 21:20 ` Rosen Penev
2026-05-21 0:06 ` Jakub Kicinski
1 sibling, 1 reply; 6+ messages in thread
From: Joe Perches @ 2026-05-19 17:37 UTC (permalink / raw)
To: Rosen Penev, netdev
Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, open list
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@ozlabs.org>
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.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net] net: fec_mpc52xx: Fix resource size format
2026-05-19 17:37 ` Joe Perches
@ 2026-05-19 21:20 ` Rosen Penev
0 siblings, 0 replies; 6+ messages in thread
From: Rosen Penev @ 2026-05-19 21:20 UTC (permalink / raw)
To: Joe Perches
Cc: netdev, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, open list
On Tue, May 19, 2026 at 10:38 AM Joe Perches <joe@perches.com> 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@ozlabs.org>
> 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.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net] net: fec_mpc52xx: Fix resource size format
2026-05-18 4:40 [PATCH net] net: fec_mpc52xx: Fix resource size format Rosen Penev
2026-05-19 17:37 ` Joe Perches
@ 2026-05-21 0:06 ` Jakub Kicinski
2026-05-21 0:42 ` Rosen Penev
1 sibling, 1 reply; 6+ messages in thread
From: Jakub Kicinski @ 2026-05-21 0:06 UTC (permalink / raw)
To: Rosen Penev
Cc: netdev, Andrew Lunn, David S. Miller, Eric Dumazet, Paolo Abeni,
Joe Perches, open list
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@gmail.com>
> ---
> 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;
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net] net: fec_mpc52xx: Fix resource size format
2026-05-21 0:06 ` Jakub Kicinski
@ 2026-05-21 0:42 ` Rosen Penev
2026-05-21 1:56 ` Jakub Kicinski
0 siblings, 1 reply; 6+ messages in thread
From: Rosen Penev @ 2026-05-21 0:42 UTC (permalink / raw)
To: Jakub Kicinski
Cc: netdev, Andrew Lunn, David S. Miller, Eric Dumazet, Paolo Abeni,
Joe Perches, open list
On Wed, May 20, 2026 at 5:06 PM Jakub Kicinski <kuba@kernel.org> wrote:
>
> 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.
64-bit powerpc. How would this driver be built on x86? There are a lot
of PPC APIs used here.
drivers/net/ethernet/freescale/fec_mpc52xx.c:46:10: fatal error:
'asm/mpc52xx.h' file not found
46 | #include <asm/mpc52xx.h>
| ^~~~~~~~~~~~~~~
>
> > Assisted-by: Codex:GPT-5.5
> > Fixes: 31b7720c8259 ("fec: Convert printks to netdev_<level>")
>
> Not a fix.
>
> > Signed-off-by: Rosen Penev <rosenp@gmail.com>
> > ---
> > 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;
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net] net: fec_mpc52xx: Fix resource size format
2026-05-21 0:42 ` Rosen Penev
@ 2026-05-21 1:56 ` Jakub Kicinski
0 siblings, 0 replies; 6+ messages in thread
From: Jakub Kicinski @ 2026-05-21 1:56 UTC (permalink / raw)
To: Rosen Penev
Cc: netdev, Andrew Lunn, David S. Miller, Eric Dumazet, Paolo Abeni,
Joe Perches, open list
On Wed, 20 May 2026 17:42:37 -0700 Rosen Penev wrote:
> > Not on 64-bit x86 builds apparently. Please provide more details
> > on which platform and compiler you see a warning and the warning.
> 64-bit powerpc. How would this driver be built on x86?
Hm, CI did rebuild a bunch of fec objects when this patch was applied.
But looking closer indeed not this exact file.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-05-21 1:56 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-18 4:40 [PATCH net] net: fec_mpc52xx: Fix resource size format Rosen Penev
2026-05-19 17:37 ` Joe Perches
2026-05-19 21:20 ` Rosen Penev
2026-05-21 0:06 ` Jakub Kicinski
2026-05-21 0:42 ` Rosen Penev
2026-05-21 1:56 ` Jakub Kicinski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox