i2c: at91: Fix compilation warning.
authorArvind Yadav <arvind.yadav.cs@gmail.com>
Wed, 31 May 2017 07:15:38 +0000 (12:45 +0530)
committerWolfram Sang <wsa@the-dreams.de>
Mon, 19 Jun 2017 14:30:04 +0000 (16:30 +0200)
Replace '%d' by '%zu' to fix the following type of compilation warnings:

drivers/i2c/busses/i2c-at91.c:277:2: warning: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘size_t’ [-Wformat=]
  dev_dbg(dev->dev, "wrote 0x%x, to go %d\n", *dev->buf, dev->buf_len);
  ^

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Acked-by: Ludovic Desroches <ludovic.desroches@microchip.com>
Tested-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/busses/i2c-at91.c

index 2525cd9bcbbdd58c281ce823f3188ca052feea1e..38dd61d621df4726d16864d82300dda52ba10575 100644 (file)
@@ -274,7 +274,7 @@ static void at91_twi_write_next_byte(struct at91_twi_dev *dev)
                if (!dev->use_alt_cmd)
                        at91_twi_write(dev, AT91_TWI_CR, AT91_TWI_STOP);
 
-       dev_dbg(dev->dev, "wrote 0x%x, to go %d\n", *dev->buf, dev->buf_len);
+       dev_dbg(dev->dev, "wrote 0x%x, to go %zu\n", *dev->buf, dev->buf_len);
 
        ++dev->buf;
 }
@@ -402,7 +402,7 @@ static void at91_twi_read_next_byte(struct at91_twi_dev *dev)
                        dev->msg->flags &= ~I2C_M_RECV_LEN;
                        dev->buf_len += *dev->buf;
                        dev->msg->len = dev->buf_len + 1;
-                       dev_dbg(dev->dev, "received block length %d\n",
+                       dev_dbg(dev->dev, "received block length %zu\n",
                                         dev->buf_len);
                } else {
                        /* abort and send the stop by reading one more byte */
@@ -415,7 +415,7 @@ static void at91_twi_read_next_byte(struct at91_twi_dev *dev)
        if (!dev->use_alt_cmd && dev->buf_len == 1)
                at91_twi_write(dev, AT91_TWI_CR, AT91_TWI_STOP);
 
-       dev_dbg(dev->dev, "read 0x%x, to go %d\n", *dev->buf, dev->buf_len);
+       dev_dbg(dev->dev, "read 0x%x, to go %zu\n", *dev->buf, dev->buf_len);
 
        ++dev->buf;
 }
@@ -622,7 +622,7 @@ static int at91_do_twi_transfer(struct at91_twi_dev *dev)
         * writing the corresponding bit into the Control Register.
         */
 
-       dev_dbg(dev->dev, "transfer: %s %d bytes.\n",
+       dev_dbg(dev->dev, "transfer: %s %zu bytes.\n",
                (dev->msg->flags & I2C_M_RD) ? "read" : "write", dev->buf_len);
 
        reinit_completion(&dev->cmd_complete);