[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4ebd2741-1788-dc05-2d04-448f3fea17ab@infradead.org>
Date: Wed, 14 Jun 2023 21:02:33 -0700
From: Randy Dunlap <rdunlap@...radead.org>
To: Jakub Kicinski <kuba@...nel.org>, davem@...emloft.net
Cc: netdev@...r.kernel.org, edumazet@...gle.com, pabeni@...hat.com,
pantelis.antoniou@...il.com, linuxppc-dev@...ts.ozlabs.org
Subject: Re: [PATCH net-next] eth: fs_enet: fix print format for resource size
On 6/14/23 20:52, Jakub Kicinski wrote:
> Randy forwarded report from Stephen that on PowerPC:
Stephen forwarded report from Randy?
netdev & pantelis were cc-ed...
> drivers/net/ethernet/freescale/fs_enet/mii-fec.c: In function 'fs_enet_mdio_probe':
> drivers/net/ethernet/freescale/fs_enet/mii-fec.c:130:50: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'resource_size_t' {aka 'long long unsigned int'} [-Wformat=]
> 130 | snprintf(new_bus->id, MII_BUS_ID_SIZE, "%x", res.start);
> | ~^ ~~~~~~~~~
> | | |
> | | resource_size_t {aka long long unsigned int}
> | unsigned int
> | %llx
>
> Use the right print format.
>
> Untested, I can't repro this warning myself. With or without
> the patch mpc512x_defconfig builds just fine.
>
> Link: https://lore.kernel.org/all/8f9f8d38-d9c7-9f1b-feb0-103d76902d14@infradead.org/
> Signed-off-by: Jakub Kicinski <kuba@...nel.org>
> ---
> CC: Randy Dunlap <rdunlap@...radead.org>
> CC: pantelis.antoniou@...il.com
> CC: linuxppc-dev@...ts.ozlabs.org
I'm using gcc-12.2.0.
Reported-by: Randy Dunlap <rdunlap@...radead.org>
Acked-by: Randy Dunlap <rdunlap@...radead.org>
Tested-by: Randy Dunlap <rdunlap@...radead.org> # build-tested
Thanks.
>
> Targeting net-next as I can't repro this, and I don't
> see recent changes which could cause this problem.
> So maybe it's something in linux-next... ?
> In any case res is a struct resource so patch shouldn't hurt.
> ---
> drivers/net/ethernet/freescale/fs_enet/mii-fec.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/freescale/fs_enet/mii-fec.c b/drivers/net/ethernet/freescale/fs_enet/mii-fec.c
> index d37d7a19a759..59a8f0bd0f5c 100644
> --- a/drivers/net/ethernet/freescale/fs_enet/mii-fec.c
> +++ b/drivers/net/ethernet/freescale/fs_enet/mii-fec.c
> @@ -127,7 +127,7 @@ static int fs_enet_mdio_probe(struct platform_device *ofdev)
> if (ret)
> goto out_res;
>
> - snprintf(new_bus->id, MII_BUS_ID_SIZE, "%x", res.start);
> + snprintf(new_bus->id, MII_BUS_ID_SIZE, "%pap", &res.start);
>
> fec->fecp = ioremap(res.start, resource_size(&res));
> if (!fec->fecp) {
--
~Randy
Powered by blists - more mailing lists