mtd: fsl-quadspi: fix printk() format warning for size_t

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Fri Nov 6 10:59:24 PST 2015


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=a5c603a22bff27f3aea7e747af4229d75278f3ff
Commit:     a5c603a22bff27f3aea7e747af4229d75278f3ff
Parent:     a23eb34198c68d9cfdcb7f09f56f2ff416b77c90
Author:     Brian Norris <computersforpeace at gmail.com>
AuthorDate: Mon Oct 12 13:35:15 2015 -0700
Committer:  Brian Norris <computersforpeace at gmail.com>
CommitDate: Mon Oct 19 09:50:45 2015 -0700

    mtd: fsl-quadspi: fix printk() format warning for size_t
    
    Seen when compile-testing on non-32-bit arch:
    
        CC      drivers/mtd/spi-nor/fsl-quadspi.o
      drivers/mtd/spi-nor/fsl-quadspi.c: In function 'fsl_qspi_read':
      drivers/mtd/spi-nor/fsl-quadspi.c:873:2: warning: format '%d' expects argument of type 'int', but argument 6 has type 'size_t' [-Wformat=]
        dev_dbg(q->dev, "cmd [%x],read from 0x%p, len:%d\n",
        ^
    
    Also drop the '0x' prefixing to the '%p' formatter, since %p already
    knows how to format pointers appropriately.
    
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
    Acked-by: Han xu <han.xu at freescale.com>
---
 drivers/mtd/spi-nor/fsl-quadspi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/spi-nor/fsl-quadspi.c b/drivers/mtd/spi-nor/fsl-quadspi.c
index 2954f89..ca259fa 100644
--- a/drivers/mtd/spi-nor/fsl-quadspi.c
+++ b/drivers/mtd/spi-nor/fsl-quadspi.c
@@ -868,7 +868,7 @@ static int fsl_qspi_read(struct spi_nor *nor, loff_t from,
 		}
 	}
 
-	dev_dbg(q->dev, "cmd [%x],read from 0x%p, len:%d\n",
+	dev_dbg(q->dev, "cmd [%x],read from %p, len:%zd\n",
 		cmd, q->ahb_addr + q->chip_base_addr + from - q->memmap_offs,
 		len);
 



More information about the linux-mtd-cvs mailing list