jianhai / rpms / kernel

Forked from rpms/kernel 3 years ago
Clone
b312fc
centosplus patch bug #13344
b312fc
b312fc
commit 9afd895271d91cd6ed743d22fce043f8c28b30ce
b312fc
Author: Arnd Bergmann <arnd@arndb.de>
b312fc
Date:   Thu Dec 8 22:57:03 2016 +0100
b312fc
b312fc
    net/mlx5e: use %pad format string for dma_addr_t
b312fc
    
b312fc
    On 32-bit ARM with 64-bit dma_addr_t I get this warning about an
b312fc
    incorrect format string:
b312fc
    
b312fc
    In file included from /git/arm-soc/drivers/net/ethernet/mellanox/mlx5/core/alloc.c:42:0:
b312fc
    drivers/net/ethernet/mellanox/mlx5/core/alloc.c: In function ‘mlx5_frag_buf_alloc_node’:
b312fc
    drivers/net/ethernet/mellanox/mlx5/core/alloc.c:134:12: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
b312fc
    
b312fc
    We have the special %pad format for printing dma_addr_t, so use that
b312fc
    to print the correct address and avoid the warning.
b312fc
    
b312fc
    Fixes: 1c1b522808a1 ("net/mlx5e: Implement Fragmented Work Queue (WQ)")
b312fc
    Signed-off-by: Arnd Bergmann <arnd@arndb.de>
b312fc
    Signed-off-by: David S. Miller <davem@davemloft.net>
b312fc
b312fc
    Applied-by: Akemi Yagi <toracat@centos.org>
b312fc
b312fc
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/alloc.c b/drivers/net/ethernet/mellanox/mlx5/core/alloc.c
b312fc
index 44791de..66bd213 100644
b312fc
--- a/drivers/net/ethernet/mellanox/mlx5/core/alloc.c
b312fc
+++ b/drivers/net/ethernet/mellanox/mlx5/core/alloc.c
b312fc
@@ -130,8 +130,8 @@ int mlx5_frag_buf_alloc_node(struct mlx5_core_dev *dev, int size,
b312fc
 		if (frag->map & ((1 << buf->page_shift) - 1)) {
b312fc
 			dma_free_coherent(&dev->pdev->dev, frag_sz,
b312fc
 					  buf->frags[i].buf, buf->frags[i].map);
b312fc
-			mlx5_core_warn(dev, "unexpected map alignment: 0x%p, page_shift=%d\n",
b312fc
-				       (void *)frag->map, buf->page_shift);
b312fc
+			mlx5_core_warn(dev, "unexpected map alignment: %pad, page_shift=%d\n",
b312fc
+				       &frag->map, buf->page_shift);
b312fc
 			goto err_free_buf;
b312fc
 		}
b312fc
 		size -= frag_sz;