diff mbox

spi/bcm63xx: fix build warning on printk format specifier

Message ID 1449066837-15773-1-git-send-email-colin.king@canonical.com (mailing list archive)
State New, archived
Headers show

Commit Message

Colin King Dec. 2, 2015, 2:33 p.m. UTC
From: Colin Ian King <colin.king@canonical.com>

Fix the following build warning when building with clang:

drivers/spi/spi-bcm63xx.c:565:16: warning: format ‘%x’ expects
  argument of type ‘unsigned int’, but argument 3 has type
  ‘resource_size_t {aka long long unsigned int}’ [-Wformat=]
  dev_info(dev, "at 0x%08x (irq %d, FIFOs size %d)\n",

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/spi/spi-bcm63xx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

kernel test robot Dec. 2, 2015, 3:46 p.m. UTC | #1
Hi Colin,

[auto build test WARNING on v4.4-rc3]
[cannot apply to spi/for-next next-20151127]

url:    https://github.com/0day-ci/linux/commits/Colin-King/spi-bcm63xx-fix-build-warning-on-printk-format-specifier/20151202-223613
config: i386-randconfig-h0-12022318 (attached as .config)
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All warnings (new ones prefixed by >>):

   In file included from include/linux/platform_device.h:14:0,
                    from drivers/spi/spi-bcm63xx.c:22:
   drivers/spi/spi-bcm63xx.c: In function 'bcm63xx_spi_probe':
>> drivers/spi/spi-bcm63xx.c:566:4: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
       (void *)r->start, irq, bs->fifo_size);
       ^
   include/linux/device.h:1174:58: note: in definition of macro 'dev_info'
    #define dev_info(dev, fmt, arg...) _dev_info(dev, fmt, ##arg)
                                                             ^

vim +566 drivers/spi/spi-bcm63xx.c

   550	
   551		/* Initialize hardware */
   552		ret = clk_prepare_enable(bs->clk);
   553		if (ret)
   554			goto out_err;
   555	
   556		bcm_spi_writeb(bs, SPI_INTR_CLEAR_ALL, SPI_INT_STATUS);
   557	
   558		/* register and we are done */
   559		ret = devm_spi_register_master(dev, master);
   560		if (ret) {
   561			dev_err(dev, "spi register failed\n");
   562			goto out_clk_disable;
   563		}
   564	
   565		dev_info(dev, "at %pa (irq %d, FIFOs size %d)\n",
 > 566			 (void *)r->start, irq, bs->fifo_size);
   567	
   568		return 0;
   569	
   570	out_clk_disable:
   571		clk_disable_unprepare(clk);
   572	out_err:
   573		spi_master_put(master);
   574		return ret;

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
diff mbox

Patch

diff --git a/drivers/spi/spi-bcm63xx.c b/drivers/spi/spi-bcm63xx.c
index 06858e0..8209b60 100644
--- a/drivers/spi/spi-bcm63xx.c
+++ b/drivers/spi/spi-bcm63xx.c
@@ -562,8 +562,8 @@  static int bcm63xx_spi_probe(struct platform_device *pdev)
 		goto out_clk_disable;
 	}
 
-	dev_info(dev, "at 0x%08x (irq %d, FIFOs size %d)\n",
-		 r->start, irq, bs->fifo_size);
+	dev_info(dev, "at %pa (irq %d, FIFOs size %d)\n",
+		 (void *)r->start, irq, bs->fifo_size);
 
 	return 0;