diff mbox series

[v2,3/4] i2c: highlander: Use proper printk format for iomem pointer

Message ID 1578992765-1418-3-git-send-email-krzk@kernel.org (mailing list archive)
State New, archived
Headers show
Series [v2,1/4] i2c: pmcmsp: Use proper printk format for resource_size_t | expand

Commit Message

Krzysztof Kozlowski Jan. 14, 2020, 9:06 a.m. UTC
iomem pointers should be printed with pointer format to hide the
actual value and fix warnings when compiling on 64-bit platform (e.g. with
COMPILE_TEST):

    drivers/i2c/busses/i2c-highlander.c: In function ‘highlander_i2c_smbus_xfer’:
    drivers/i2c/busses/i2c-highlander.c:325:22: warning:
        format ‘%d’ expects argument of type ‘int’,
        but argument 3 has type ‘size_t {aka long unsigned int}’ [-Wformat=]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>

---

Changes since v1:
1. None
---
 drivers/i2c/busses/i2c-highlander.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Wolfram Sang Jan. 15, 2020, 5:43 p.m. UTC | #1
On Tue, Jan 14, 2020 at 10:06:04AM +0100, Krzysztof Kozlowski wrote:
> iomem pointers should be printed with pointer format to hide the
> actual value and fix warnings when compiling on 64-bit platform (e.g. with
> COMPILE_TEST):
> 
>     drivers/i2c/busses/i2c-highlander.c: In function ‘highlander_i2c_smbus_xfer’:
>     drivers/i2c/busses/i2c-highlander.c:325:22: warning:
>         format ‘%d’ expects argument of type ‘int’,
>         but argument 3 has type ‘size_t {aka long unsigned int}’ [-Wformat=]
> 
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>

Wrong commit message. buf_len is size_t and not an iomem pointer.

> ---
> 
> Changes since v1:
> 1. None
> ---
>  drivers/i2c/busses/i2c-highlander.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/i2c/busses/i2c-highlander.c b/drivers/i2c/busses/i2c-highlander.c
> index abfe3094c047..803dad70e2a7 100644
> --- a/drivers/i2c/busses/i2c-highlander.c
> +++ b/drivers/i2c/busses/i2c-highlander.c
> @@ -322,7 +322,7 @@ static int highlander_i2c_smbus_xfer(struct i2c_adapter *adap, u16 addr,
>  		tmp |= (SMMR_MODE0 | SMMR_MODE1);
>  		break;
>  	default:
> -		dev_err(dev->dev, "unsupported xfer size %d\n", dev->buf_len);
> +		dev_err(dev->dev, "unsupported xfer size %zu\n", dev->buf_len);
>  		return -EINVAL;
>  	}
>  
> -- 
> 2.7.4
>
Krzysztof Kozlowski Jan. 15, 2020, 7:57 p.m. UTC | #2
On Wed, Jan 15, 2020 at 06:43:37PM +0100, Wolfram Sang wrote:
> On Tue, Jan 14, 2020 at 10:06:04AM +0100, Krzysztof Kozlowski wrote:
> > iomem pointers should be printed with pointer format to hide the
> > actual value and fix warnings when compiling on 64-bit platform (e.g. with
> > COMPILE_TEST):
> > 
> >     drivers/i2c/busses/i2c-highlander.c: In function ‘highlander_i2c_smbus_xfer’:
> >     drivers/i2c/busses/i2c-highlander.c:325:22: warning:
> >         format ‘%d’ expects argument of type ‘int’,
> >         but argument 3 has type ‘size_t {aka long unsigned int}’ [-Wformat=]
> > 
> > Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> 
> Wrong commit message. buf_len is size_t and not an iomem pointer.

I'll fix it up.

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/drivers/i2c/busses/i2c-highlander.c b/drivers/i2c/busses/i2c-highlander.c
index abfe3094c047..803dad70e2a7 100644
--- a/drivers/i2c/busses/i2c-highlander.c
+++ b/drivers/i2c/busses/i2c-highlander.c
@@ -322,7 +322,7 @@  static int highlander_i2c_smbus_xfer(struct i2c_adapter *adap, u16 addr,
 		tmp |= (SMMR_MODE0 | SMMR_MODE1);
 		break;
 	default:
-		dev_err(dev->dev, "unsupported xfer size %d\n", dev->buf_len);
+		dev_err(dev->dev, "unsupported xfer size %zu\n", dev->buf_len);
 		return -EINVAL;
 	}