Skip to content

Commit

Permalink
net: allwinner: Fix print format
Browse files Browse the repository at this point in the history
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.

Reported-by: Kees Cook <keescook@chromium.org>
Fixes: 47869e8 ("sun4i-emac.c: add dma support")
Link: https://lore.kernel.org/r/20220108034438.2227343-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Jakub Kicinski committed Jan 10, 2022
1 parent 07b17f0 commit 009e4ee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ethernet/allwinner/sun4i-emac.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 009e4ee

Please sign in to comment.