eth: fs_enet: fix print format for resource size
Subsystems (3)
Jakub Kicinski
maintainerPATCH 1/1 eth: fs_enet: fix print format for resource size
Randy forwarded report from Stephen that on PowerPC:
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
| %llxUse the right print format.
Untested, I can't repro this warning myself. With or without the patch mpc512x_defconfig builds just fine.
---
CC: Randy Dunlap <[email protected]>
CC: [email protected]
CC: [email protected]
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(-)
drivers/net/ethernet/freescale/fs_enet/mii-fec.c +1 -1
@@ -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) {
Signature · 1 line
2.40.1
Quoted 1 line · Jakub Kicinski
Randy forwarded report from Stephen that on PowerPC:
Stephen forwarded report from Randy?
netdev & pantelis were cc-ed...
Quoted 14 lines
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 | %llxUse the right print format.
Untested, I can't repro this warning myself. With or without the patch
mpc512x_defconfigbuilds just fine.
Quoted 6 lines
Signed-off-by Jakub Kicinski <[email protected]>---
CC: Randy Dunlap <[email protected]>
CC: [email protected]
CC: [email protected]
I'm using gcc-12.2.0.
Thanks.
Quoted 22 lines
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(-)drivers/net/ethernet/freescale/fs_enet/mii-fec.c +1
-1@@ -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) {
Signature · 1 line
~Randy
Jakub Kicinski
maintainerQuoted 6 lines · On Wed, 14 Jun 2023 21:02:33 -0700 Randy Dunlap wrote:
Quoted 1 line · Jakub Kicinski
Randy forwarded report from Stephen that on PowerPC:
Stephen forwarded report from Randy?
netdev & pantelis were cc-ed...
Ah, I misread, you were reporting to Stephen the status for the latest linux-next!
https://lore.kernel.org/all/[email protected]/
Seems obvious in hindsight, sorry. I'll reword when applying.
Quoted 21 lines
Quoted 14 lines
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 | %llxUse the right print format.
Untested, I can't repro this warning myself. With or without the patch
mpc512x_defconfigbuilds just fine.Quoted 6 lines
Signed-off-by Jakub Kicinski <[email protected]>---
CC: Randy Dunlap <[email protected]>
CC: [email protected]
CC: [email protected]
Quoted 5 lines
I'm using gcc-12.2.0.
Reported-by Randy Dunlap <[email protected]>Acked-by Randy Dunlap <[email protected]>
Thank you! GCC 11.1 here, FWIW.
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 4 lines · On Wed, 14 Jun 2023 20:52:31 -0700 you wrote:
Randy forwarded report from Stephen that on PowerPC:
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=]
Quoted 8 lines
130 | snprintf(new_bus->id, MII_BUS_ID_SIZE, "%x", res.start); | ~^ ~~~~~~~~~ | | | | | resource_size_t {aka long long unsigned int} | unsigned int | %llx[...]
Here is the summary with links:
- [net-next] eth: fs_enet: fix print format for resource size
https://git.kernel.org/netdev/net-next/c/8f72fb1578a9
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html