* [PATCH] i2c: i2c-imx: Fix format warning for dev_dbg
@ 2014-08-06 2:54 Xiubo Li
2014-08-06 3:09 ` Joe Perches
0 siblings, 1 reply; 3+ messages in thread
From: Xiubo Li @ 2014-08-06 2:54 UTC (permalink / raw)
To: wsa-z923LK4zBo2bacvFa/9K2g, linux-i2c-u79uwXL29TY76Z2rM5mHXA
Cc: s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ, jg1.han-Sze3O3UU22JBDgjK7y7TUQ,
u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
b35083-KZfg59tc24xl57MIdRCFDg, Xiubo Li
drivers/i2c/busses/i2c-imx.c: In function i2c_imx_probe()
drivers/i2c/busses/i2c-imx.c:689:2: warning: format 0x%x expects argument
of type unsigned int, but argument 4 has type resource_size_t [-Wformat=]
dev_dbg(&i2c_imx->adapter.dev, "device resources from 0x%x to 0x%x\n",
^
drivers/i2c/busses/i2c-imx.c:689:2: warning: format 0x%x expects argument
of type unsigned int, but argument 5 has type resource_size_t [-Wformat=]
drivers/i2c/busses/i2c-imx.c:691:2: warning: format %d expects argument
of type int, but argument 4 has type resource_size_t [-Wformat=]
dev_dbg(&i2c_imx->adapter.dev, "allocated %d bytes at 0x%x\n",
^
drivers/i2c/busses/i2c-imx.c:691:2: warning: format 0x%x expects argument
of type unsigned int, but argument 5 has type resource_size_t [-Wformat=]
Signed-off-by: Xiubo Li <Li.Xiubo-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
---
drivers/i2c/busses/i2c-imx.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
index 1d7efa3..ba4ba32 100644
--- a/drivers/i2c/busses/i2c-imx.c
+++ b/drivers/i2c/busses/i2c-imx.c
@@ -687,9 +687,9 @@ static int i2c_imx_probe(struct platform_device *pdev)
dev_dbg(&i2c_imx->adapter.dev, "claimed irq %d\n", irq);
dev_dbg(&i2c_imx->adapter.dev, "device resources from 0x%x to 0x%x\n",
- res->start, res->end);
+ (unsigned int)res->start, (unsigned int)res->end);
dev_dbg(&i2c_imx->adapter.dev, "allocated %d bytes at 0x%x\n",
- resource_size(res), res->start);
+ (unsigned int)resource_size(res), (unsigned int)res->start);
dev_dbg(&i2c_imx->adapter.dev, "adapter name: \"%s\"\n",
i2c_imx->adapter.name);
dev_info(&i2c_imx->adapter.dev, "IMX I2C adapter registered\n");
--
1.8.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] i2c: i2c-imx: Fix format warning for dev_dbg
2014-08-06 2:54 [PATCH] i2c: i2c-imx: Fix format warning for dev_dbg Xiubo Li
@ 2014-08-06 3:09 ` Joe Perches
2014-08-06 3:28 ` Li.Xiubo
0 siblings, 1 reply; 3+ messages in thread
From: Joe Perches @ 2014-08-06 3:09 UTC (permalink / raw)
To: Xiubo Li
Cc: wsa, linux-i2c, s.hauer, jg1.han, u.kleine-koenig, linux-kernel,
b35083
On Wed, 2014-08-06 at 10:54 +0800, Xiubo Li wrote:
> drivers/i2c/busses/i2c-imx.c: In function i2c_imx_probe()
> drivers/i2c/busses/i2c-imx.c:689:2: warning: format 0x%x expects argument
> of type unsigned int, but argument 4 has type resource_size_t [-Wformat=]
> dev_dbg(&i2c_imx->adapter.dev, "device resources from 0x%x to 0x%x\n",
[]
> diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
[]
> @@ -687,9 +687,9 @@ static int i2c_imx_probe(struct platform_device *pdev)
>
> dev_dbg(&i2c_imx->adapter.dev, "claimed irq %d\n", irq);
> dev_dbg(&i2c_imx->adapter.dev, "device resources from 0x%x to 0x%x\n",
> - res->start, res->end);
> + (unsigned int)res->start, (unsigned int)res->end);
Probably better to use:
dev_dbg(&i2c_imx->adapter.dev, "device resources: %pR\n, res);
> dev_dbg(&i2c_imx->adapter.dev, "allocated %d bytes at 0x%x\n",
> - resource_size(res), res->start);
> + (unsigned int)resource_size(res), (unsigned int)res->start);
and remove this.
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH] i2c: i2c-imx: Fix format warning for dev_dbg
2014-08-06 3:09 ` Joe Perches
@ 2014-08-06 3:28 ` Li.Xiubo
0 siblings, 0 replies; 3+ messages in thread
From: Li.Xiubo @ 2014-08-06 3:28 UTC (permalink / raw)
To: Joe Perches
Cc: wsa@the-dreams.de, linux-i2c@vger.kernel.org,
s.hauer@pengutronix.de, jg1.han@samsung.com,
u.kleine-koenig@pengutronix.de, linux-kernel@vger.kernel.org,
Jingchang Lu
> > drivers/i2c/busses/i2c-imx.c: In function i2c_imx_probe()
> > drivers/i2c/busses/i2c-imx.c:689:2: warning: format 0x%x expects argument
> > of type unsigned int, but argument 4 has type resource_size_t [-Wformat=]
> > dev_dbg(&i2c_imx->adapter.dev, "device resources from 0x%x to 0x%x\n",
> []
> > diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
> []
> > @@ -687,9 +687,9 @@ static int i2c_imx_probe(struct platform_device *pdev)
> >
> > dev_dbg(&i2c_imx->adapter.dev, "claimed irq %d\n", irq);
> > dev_dbg(&i2c_imx->adapter.dev, "device resources from 0x%x to 0x%x\n",
> > - res->start, res->end);
> > + (unsigned int)res->start, (unsigned int)res->end);
>
> Probably better to use:
>
> dev_dbg(&i2c_imx->adapter.dev, "device resources: %pR\n, res);
>
Yes, this is perfect.
> > dev_dbg(&i2c_imx->adapter.dev, "allocated %d bytes at 0x%x\n",
> > - resource_size(res), res->start);
> > + (unsigned int)resource_size(res), (unsigned int)res->start);
>
> and remove this.
>
I will follow your advice.
Thanks,
BRs
Xiubo
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-08-06 3:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-06 2:54 [PATCH] i2c: i2c-imx: Fix format warning for dev_dbg Xiubo Li
2014-08-06 3:09 ` Joe Perches
2014-08-06 3:28 ` Li.Xiubo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox