Skip to contentSkip to conversation

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

PATCH In review Brian Norris 3 participants 6 messages Oct 12, 2015 – Oct 14, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 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.

---
 drivers/mtd/spi-nor/fsl-quadspi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/spi-nor/fsl-quadspi.c +1 -1
index 2954f89fc8be..ca259faf4591 100644
@@ -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);
 
Signature · 1 line
2.6.0.rc2.230.g3dd15c0
#1 lore raw

PATCH 2/2 mtd: fsl-quadspi: allow building for other ARCHes with COMPILE_TEST

This driver doesn't actually need ARCH_MXC to compile. Relax the constraints.

---
 drivers/mtd/spi-nor/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/mtd/spi-nor/Kconfig +2 -1
index 89bf4c1faa2b..2fe2a7e90fa9 100644
@@ -23,7 +23,8 @@ config MTD_SPI_NOR_USE_4K_SECTORS
 
 config SPI_FSL_QUADSPI
 	tristate "Freescale Quad SPI controller"
-	depends on ARCH_MXC
+	depends on ARCH_MXC || COMPILE_TEST
+	depends on HAS_IOMEM
 	help
 	  This enables support for the Quad SPI controller in master mode.
 	  This controller does not support generic SPI. It only supports
Signature · 1 line
2.6.0.rc2.230.g3dd15c0
Acked-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] mtd: fsl-quadspi: allow building for other ARCHes with COMPILE_TEST

Quoted 14 lines · Brian Norris

This driver doesn't actually need ARCH_MXC to compile. Relax the constraints.

---
 drivers/mtd/spi-nor/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/mtd/spi-nor/Kconfig +0 -0
index 89bf4c1faa2b..2fe2a7e90fa9 100644

drivers/mtd/spi-nor/Kconfig config MTD_SPI_NOR_USE_4K_SECTORS · line 30

Quoted 9 lines
drivers/mtd/spi-nor/Kconfig +2 -1
@@ -23,7 +23,8 @@ config MTD_SPI_NOR_USE_4K_SECTORS
 
 config SPI_FSL_QUADSPI
        tristate "Freescale Quad SPI controller"
-       depends on ARCH_MXC
+       depends on ARCH_MXC || COMPILE_TEST
+       depends on HAS_IOMEM
        help
          This enables support for the Quad SPI controller in master mode.
          This controller does not support generic SPI. It only supports
Quoted 7 lines

--
2.6.0.rc2.230.g3dd15c0

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

Acked-by on v1 1/2
#3 lore raw
In reply to Brian Norris
Quoted 22 lines · Brian Norris

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.

---
 drivers/mtd/spi-nor/fsl-quadspi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/spi-nor/fsl-quadspi.c +0 -0
index 2954f89fc8be..ca259faf4591 100644

drivers/mtd/spi-nor/fsl-quadspi.c static int fsl_qspi_read(struct spi_nor *nor, loff_t from, · line 874

Quoted 8 lines
drivers/mtd/spi-nor/fsl-quadspi.c +1 -1
@@ -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);
 
Quoted 3 lines
Signature · 1 line
2.6.0.rc2.230.g3dd15c0
Signature · 3 lines
Best Regards,

Han "Allen" Xu
Acked-by on v1 1/2
#4 lore raw
In reply to Brian Norris
Quoted 22 lines · Brian Norris

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.

---
 drivers/mtd/spi-nor/fsl-quadspi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/spi-nor/fsl-quadspi.c +0 -0
index 2954f89fc8be..ca259faf4591 100644

drivers/mtd/spi-nor/fsl-quadspi.c static int fsl_qspi_read(struct spi_nor *nor, loff_t from, · line 874

Quoted 8 lines
drivers/mtd/spi-nor/fsl-quadspi.c +1 -1
@@ -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);
 
Quoted 7 lines

--
2.6.0.rc2.230.g3dd15c0

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

#5 lore raw
In reply to Brian Norris
Quoted 5 lines · Brian Norris

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=]

Quoted 8 lines
    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.

Pushed both to l2-mtd.git