lkml.org 
[lkml]   [2016]   [Mar]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] cxgbit: fix dma_addr_t printk format
Date
The newly added driver prints a dma_addr_t using the %llx format string,
but that is wrong on most 32-bit architectures:

drivers/target/iscsi/cxgbit/cxgbit_ddp.c: In function 'cxgbit_dump_sgl':
drivers/target/iscsi/cxgbit/cxgbit_ddp.c:180:10: error: format '%llx' expects argument of type 'long long unsigned int', but argument 8 has type 'dma_addr_t {aka unsigned int}' [-Werror=format=]
pr_info("\t%d/%u, 0x%p: len %u, off %u, pg 0x%p, dma 0x%llx, %u\n",

Unfortunately, we can't use the %pad format string here because
we are not printing an lvalue, so we have to add a cast to u64, which
matches the format string on all architectures.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: c49aa56e556d ("cxgbit: add cxgbit_ddp.c")
---
drivers/target/iscsi/cxgbit/cxgbit_ddp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/target/iscsi/cxgbit/cxgbit_ddp.c b/drivers/target/iscsi/cxgbit/cxgbit_ddp.c
index 07e2bc86d0df..d667bc88e21d 100644
--- a/drivers/target/iscsi/cxgbit/cxgbit_ddp.c
+++ b/drivers/target/iscsi/cxgbit/cxgbit_ddp.c
@@ -179,7 +179,7 @@ cxgbit_dump_sgl(const char *cap, struct scatterlist *sgl, int nents)
for_each_sg(sgl, sg, nents, i)
pr_info("\t%d/%u, 0x%p: len %u, off %u, pg 0x%p, dma 0x%llx, %u\n",
i, nents, sg, sg->length, sg->offset, sg_page(sg),
- sg_dma_address(sg), sg_dma_len(sg));
+ (u64)sg_dma_address(sg), sg_dma_len(sg));
}

static int cxgbit_ddp_sgl_check(struct scatterlist *sgl, int nents)
--
2.7.0
\
 
 \ /
  Last update: 2016-03-05 02:01    [W:0.039 / U:0.396 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site