mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jingoo Han <jg1.han@samsung.com>
To: "'Xiubo Li'" <Li.Xiubo@freescale.com>
Cc: wsa@the-dreams.de, linux-i2c@vger.kernel.org, joe@perches.com,
	s.hauer@pengutronix.de, u.kleine-koenig@pengutronix.de,
	linux-kernel@vger.kernel.org, b35083@freescale.com,
	"'Jingoo Han'" <jg1.han@samsung.com>
Subject: Re: [PATCHv2] i2c: i2c-imx: Fix format warning for dev_dbg
Date: Wed, 06 Aug 2014 13:23:45 +0900	[thread overview]
Message-ID: <002801cfb12e$36620840$a32618c0$%han@samsung.com> (raw)
In-Reply-To: <1407296708-12563-1-git-send-email-Li.Xiubo@freescale.com>

On Wednesday, August 06, 2014 12:45 PM, Xiubo Li wrote:

The subject of the commit looks too general.
How about the following?

i2c: i2c-imx: Use printf extension %pR for struct resource

Best regards,
Jingoo Han

> 
> 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@freescale.com>
> ---
> 
> Change in v2:
> - Follow Joe Perches's advice.
> 
> 
> 
> 
> 
>  drivers/i2c/busses/i2c-imx.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
> index 1d7efa3..b8a9543 100644
> --- a/drivers/i2c/busses/i2c-imx.c
> +++ b/drivers/i2c/busses/i2c-imx.c
> @@ -686,10 +686,7 @@ static int i2c_imx_probe(struct platform_device *pdev)
>  	clk_disable_unprepare(i2c_imx->clk);
> 
>  	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);
> -	dev_dbg(&i2c_imx->adapter.dev, "allocated %d bytes at 0x%x\n",
> -		resource_size(res), res->start);
> +	dev_dbg(&i2c_imx->adapter.dev, "device resources: %pR\n", res);
>  	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


  reply	other threads:[~2014-08-06  4:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-06  3:45 Xiubo Li
2014-08-06  4:23 ` Jingoo Han [this message]
2014-08-06  5:09   ` Li.Xiubo
2014-08-06 19:00 ` Wolfram Sang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='002801cfb12e$36620840$a32618c0$%han@samsung.com' \
    --to=jg1.han@samsung.com \
    --cc=Li.Xiubo@freescale.com \
    --cc=b35083@freescale.com \
    --cc=joe@perches.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=wsa@the-dreams.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®