Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1538906

[PATCH net-next 1/3] net/mlx5e: use %pad format string for dma_addr_t

From Arnd Bergmann <arnd@arndb.de>
Newsgroups linux.kernel
Subject [PATCH net-next 1/3] net/mlx5e: use %pad format string for dma_addr_t
Date 2016-12-08 23:00 +0100
Message-ID <sMeTo-30n-13@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


On 32-bit ARM with 64-bit dma_addr_t I get this warning about an
incorrect format string:

In file included from /git/arm-soc/drivers/net/ethernet/mellanox/mlx5/core/alloc.c:42:0:
drivers/net/ethernet/mellanox/mlx5/core/alloc.c: In function ‘mlx5_frag_buf_alloc_node’:
drivers/net/ethernet/mellanox/mlx5/core/alloc.c:134:12: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]

We have the special %pad format for printing dma_addr_t, so use that
to print the correct address and avoid the warning.

Fixes: 1c1b522808a1 ("net/mlx5e: Implement Fragmented Work Queue (WQ)")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/net/ethernet/mellanox/mlx5/core/alloc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/alloc.c b/drivers/net/ethernet/mellanox/mlx5/core/alloc.c
index 44791de5afe6..66bd213f35ce 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/alloc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/alloc.c
@@ -130,8 +130,8 @@ int mlx5_frag_buf_alloc_node(struct mlx5_core_dev *dev, int size,
 		if (frag->map & ((1 << buf->page_shift) - 1)) {
 			dma_free_coherent(&dev->pdev->dev, frag_sz,
 					  buf->frags[i].buf, buf->frags[i].map);
-			mlx5_core_warn(dev, "unexpected map alignment: 0x%p, page_shift=%d\n",
-				       (void *)frag->map, buf->page_shift);
+			mlx5_core_warn(dev, "unexpected map alignment: %pad, page_shift=%d\n",
+				       &frag->map, buf->page_shift);
 			goto err_free_buf;
 		}
 		size -= frag_sz;
-- 
2.9.0

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH net-next 1/3] net/mlx5e: use %pad format string for dma_addr_t Arnd Bergmann <arnd@arndb.de> - 2016-12-08 23:00 +0100
  [PATCH net-next 2/3] net: xgene: move xgene_cle_ptree_ewdn data off stack Arnd Bergmann <arnd@arndb.de> - 2016-12-08 23:00 +0100
    Re: [PATCH net-next 2/3] net: xgene: move xgene_cle_ptree_ewdn  data off stack David Miller <davem@davemloft.net> - 2016-12-09 03:40 +0100
  Re: [PATCH net-next 1/3] net/mlx5e: use %pad format string for  dma_addr_t David Miller <davem@davemloft.net> - 2016-12-09 03:40 +0100

csiph-web