From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Simon Horman <horms@kernel.org>,
Geert Uytterhoeven <geert@linux-m68k.org>,
Daniel Machon <daniel.machon@microchip.com>,
Jakub Kicinski <kuba@kernel.org>, Sasha Levin <sashal@kernel.org>,
andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
pabeni@redhat.com, u.kleine-koenig@baylibre.com,
netdev@vger.kernel.org
Subject: [PATCH AUTOSEL 6.1 12/48] net: fec_mpc52xx_phy: Use %pa to format resource_size_t
Date: Sun, 24 Nov 2024 08:48:35 -0500 [thread overview]
Message-ID: <20241124134950.3348099-12-sashal@kernel.org> (raw)
In-Reply-To: <20241124134950.3348099-1-sashal@kernel.org>
From: Simon Horman <horms@kernel.org>
[ Upstream commit 020bfdc4ed94be472138c891bde4d14241cf00fd ]
The correct format string for resource_size_t is %pa which
acts on the address of the variable to be formatted [1].
[1] https://elixir.bootlin.com/linux/v6.11.3/source/Documentation/core-api/printk-formats.rst#L229
Introduced by commit 9d9326d3bc0e ("phy: Change mii_bus id field to a string")
Flagged by gcc-14 as:
drivers/net/ethernet/freescale/fec_mpc52xx_phy.c: In function 'mpc52xx_fec_mdio_probe':
drivers/net/ethernet/freescale/fec_mpc52xx_phy.c:97:46: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'resource_size_t' {aka 'long long unsigned int'} [-Wformat=]
97 | snprintf(bus->id, MII_BUS_ID_SIZE, "%x", res.start);
| ~^ ~~~~~~~~~
| | |
| | resource_size_t {aka long long unsigned int}
| unsigned int
| %llx
No functional change intended.
Compile tested only.
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Closes: https://lore.kernel.org/netdev/711d7f6d-b785-7560-f4dc-c6aad2cce99@linux-m68k.org/
Signed-off-by: Simon Horman <horms@kernel.org>
Reviewed-by: Daniel Machon <daniel.machon@microchip.com>
Link: https://patch.msgid.link/20241014-net-pa-fmt-v1-1-dcc9afb8858b@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/freescale/fec_mpc52xx_phy.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/freescale/fec_mpc52xx_phy.c b/drivers/net/ethernet/freescale/fec_mpc52xx_phy.c
index 95f778cce98cb..e4911a76f08eb 100644
--- a/drivers/net/ethernet/freescale/fec_mpc52xx_phy.c
+++ b/drivers/net/ethernet/freescale/fec_mpc52xx_phy.c
@@ -93,7 +93,7 @@ static int mpc52xx_fec_mdio_probe(struct platform_device *of)
goto out_free;
}
- snprintf(bus->id, MII_BUS_ID_SIZE, "%x", res.start);
+ snprintf(bus->id, MII_BUS_ID_SIZE, "%pa", &res.start);
bus->priv = priv;
bus->parent = dev;
--
2.43.0
next prev parent reply other threads:[~2024-11-24 13:50 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20241124134950.3348099-1-sashal@kernel.org>
2024-11-24 13:48 ` [PATCH AUTOSEL 6.1 10/48] r8169: don't apply UDP padding quirk on RTL8126A Sasha Levin
2024-11-24 13:48 ` Sasha Levin [this message]
2024-11-24 13:48 ` [PATCH AUTOSEL 6.1 13/48] net: ethernet: fs_enet: Use %pa to format resource_size_t Sasha Levin
2024-11-24 13:48 ` [PATCH AUTOSEL 6.1 14/48] net/sched: cbs: Fix integer overflow in cbs_set_port_rate() Sasha Levin
2024-11-24 13:48 ` [PATCH AUTOSEL 6.1 15/48] af_packet: avoid erroring out after sock_init_data() in packet_create() Sasha Levin
2024-11-24 13:48 ` [PATCH AUTOSEL 6.1 19/48] net: ieee802154: do not leave a dangling sk pointer in ieee802154_create() Sasha Levin
2024-11-24 13:48 ` [PATCH AUTOSEL 6.1 20/48] net: inet: do not leave a dangling sk pointer in inet_create() Sasha Levin
2024-11-24 13:48 ` [PATCH AUTOSEL 6.1 21/48] net: inet6: do not leave a dangling sk pointer in inet6_create() Sasha Levin
2024-11-24 13:48 ` [PATCH AUTOSEL 6.1 25/48] net: sfp: change quirks for Alcatel Lucent G-010S-P Sasha Levin
2024-11-24 13:48 ` [PATCH AUTOSEL 6.1 35/48] net: enetc: remove ERR050089 workaround for i.MX95 Sasha Levin
2024-11-25 1:55 ` Wei Fang
2024-11-24 13:48 ` [PATCH AUTOSEL 6.1 36/48] net: enetc: add i.MX95 EMDIO support Sasha Levin
2024-11-24 13:49 ` [PATCH AUTOSEL 6.1 42/48] dsa: qca8k: Use nested lock to avoid splat Sasha Levin
2024-11-24 13:49 ` [PATCH AUTOSEL 6.1 46/48] rocker: fix link status detection in rocker_carrier_init() Sasha Levin
2024-11-24 13:49 ` [PATCH AUTOSEL 6.1 47/48] net/neighbor: clear error in case strict check is not set Sasha Levin
2024-11-24 13:49 ` [PATCH AUTOSEL 6.1 48/48] netpoll: Use rcu_access_pointer() in __netpoll_setup Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241124134950.3348099-12-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=daniel.machon@microchip.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=geert@linux-m68k.org \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=stable@vger.kernel.org \
--cc=u.kleine-koenig@baylibre.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).