Skip to contentSkip to conversation

net: allwinner: Fix print format

PATCH Applied Jakub Kicinski 2 participants 2 messages Jan 8, 2022 – Jan 10, 2022

Subsystems (3)
lore
Share & tools
lore

Jakub Kicinski

author maintainer
#0 lore raw

PATCH 1/1 net: allwinner: Fix print format

Kees reports quoted commit introduced the following warning on arm64:

drivers/net/ethernet/allwinner/sun4i-emac.c:922:60: error: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'resource_size_t' {aka 'long long unsigned int'} [-Werror=format=]

  922 |         netdev_info(ndev, "get io resource from device: 0x%x, size = %u\n",
      |                                                           ~^
      |                                                            |                                      |                                                            unsigned int
      |                                                           %llx
  923 |                     regs->start, resource_size(regs));
      |                     ~~~~~~~~~~~
      |                         |
      |                         resource_size_t {aka long long unsigned int}

.. and another one like that for resource_size().

Switch to %pa and a cast.

Fixes 47869e82c8b8 ("sun4i-emac.c: add dma support")
---
 drivers/net/ethernet/allwinner/sun4i-emac.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/allwinner/sun4i-emac.c +2 -2
index 964227e342ee..849de4564709 100644
@@ -919,8 +919,8 @@ static int emac_configure_dma(struct emac_board_info *db)
 		goto out_clear_chan;
 	}
 
-	netdev_info(ndev, "get io resource from device: 0x%x, size = %u\n",
-		    regs->start, resource_size(regs));
+	netdev_info(ndev, "get io resource from device: %pa, size = %u\n",
+		    &regs->start, (unsigned int)resource_size(regs));
 	db->emac_rx_fifo = regs->start + EMAC_RX_IO_DATA_REG;
 
 	db->rx_chan = dma_request_chan(&pdev->dev, "rx");
Signature · 1 line
2.31.1
#1 lore raw
This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:

Quoted 12 lines · On Fri, 7 Jan 2022 19:44:38 -0800 you wrote:

Kees reports quoted commit introduced the following warning on arm64:

drivers/net/ethernet/allwinner/sun4i-emac.c:922:60: error: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'resource_size_t' {aka 'long long unsigned int'} [-Werror=format=]

  922 |         netdev_info(ndev, "get io resource from device: 0x%x, size = %u\n",
      |                                                           ~^
      |                                                            |                                      |                                                            unsigned int
      |                                                           %llx
  923 |                     regs->start, resource_size(regs));
      |                     ~~~~~~~~~~~
      |                         |
      |                         resource_size_t {aka long long unsigned int}
Quoted 1 line

[...]

Here is the summary with links:
- [net-next] net: allwinner: Fix print format

    https://git.kernel.org/netdev/net-next/c/009e4ee381a0

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html