crypto: sahara - fix debug output for 64-bit dma_addr_t
authorArnd Bergmann <arnd@arndb.de>
Tue, 8 Dec 2015 15:24:22 +0000 (16:24 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 10 Dec 2015 14:39:50 +0000 (22:39 +0800)
The sahara_dump_descriptors and sahara_dump_links functions attempt
to print a dma_addr_t value with a 0x%08x format string, which
produces a warning when dma_addr_t is 64-bit wide:

drivers/crypto/sahara.c:419:120: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'dma_addr_t {aka long long unsigned int}' [-Wformat=]

This changes the code to use the %pad format string that is meant
for dma_addr_t, which avoids the warning and gives us the correct
output in all configurations.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/sahara.c

index 38bf12ae5589ad09e53beab333c66d7a52942f9c..6c4f91c5e6b352e13f630cb71f4f236cf5e75263 100644 (file)
@@ -416,8 +416,8 @@ static void sahara_dump_descriptors(struct sahara_dev *dev)
                return;
 
        for (i = 0; i < SAHARA_MAX_HW_DESC; i++) {
-               dev_dbg(dev->device, "Descriptor (%d) (0x%08x):\n",
-                       i, dev->hw_phys_desc[i]);
+               dev_dbg(dev->device, "Descriptor (%d) (%pad):\n",
+                       i, &dev->hw_phys_desc[i]);
                dev_dbg(dev->device, "\thdr = 0x%08x\n", dev->hw_desc[i]->hdr);
                dev_dbg(dev->device, "\tlen1 = %u\n", dev->hw_desc[i]->len1);
                dev_dbg(dev->device, "\tp1 = 0x%08x\n", dev->hw_desc[i]->p1);
@@ -437,8 +437,8 @@ static void sahara_dump_links(struct sahara_dev *dev)
                return;
 
        for (i = 0; i < SAHARA_MAX_HW_LINK; i++) {
-               dev_dbg(dev->device, "Link (%d) (0x%08x):\n",
-                       i, dev->hw_phys_link[i]);
+               dev_dbg(dev->device, "Link (%d) (%pad):\n",
+                       i, &dev->hw_phys_link[i]);
                dev_dbg(dev->device, "\tlen = %u\n", dev->hw_link[i]->len);
                dev_dbg(dev->device, "\tp = 0x%08x\n", dev->hw_link[i]->p);
                dev_dbg(dev->device, "\tnext = 0x%08x\n",