]> git.sur5r.net Git - u-boot/commitdiff
spi: cadence_qspi: Fix compilation warning
authorLey Foon Tan <ley.foon.tan@intel.com>
Fri, 6 Jul 2018 02:39:14 +0000 (10:39 +0800)
committerMarek Vasut <marex@denx.de>
Thu, 12 Jul 2018 07:22:11 +0000 (09:22 +0200)
Use "%zu" for size_t data type.

Compilation warning as below:

In file included from include/linux/bug.h:7:0,
                 from include/common.h:26,
                 from drivers/spi/cadence_qspi.c:8:
drivers/spi/cadence_qspi.c: In function ‘cadence_spi_xfer’:
drivers/spi/cadence_qspi.c:211:8: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘size_t {aka long unsigned int}’ [-Wformat=]
  debug("%s: len=%d [bytes]\n", __func__, data_bytes);
        ^
include/linux/printk.h:37:21: note: in definition of macro ‘pr_fmt’
 #define pr_fmt(fmt) fmt
                     ^~~
include/log.h:142:2: note: in expansion of macro ‘debug_cond’
  debug_cond(_DEBUG, fmt, ##args)
  ^~~~~~~~~~
drivers/spi/cadence_qspi.c:211:2: note: in expansion of macro ‘debug’
  debug("%s: len=%d [bytes]\n", __func__, data_bytes);

Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
Acked-by: Marek Vasut <marex@denx.de>
drivers/spi/cadence_qspi.c

index 91742ba5f157ee22a43444ed2f5a40c7c4c50cd3..29db6fa36844b78971a7755e4334a7092268f34f 100644 (file)
@@ -207,7 +207,7 @@ static int cadence_spi_xfer(struct udevice *dev, unsigned int bitlen,
        } else {
                data_bytes = bitlen / 8;
        }
-       debug("%s: len=%d [bytes]\n", __func__, data_bytes);
+       debug("%s: len=%zu [bytes]\n", __func__, data_bytes);
 
        /* Set Chip select */
        cadence_qspi_apb_chipselect(base, spi_chip_select(dev),