linux-rtc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Randy Dunlap" <rdunlap@infradead.org>, linux-kernel@vger.kernel.org
Cc: "Qin Jian" <qinjian@cqplus1.com>,
	"Vincent Shih" <vincent.sunplus@gmail.com>,
	"Alessandro Zummo" <a.zummo@towertech.it>,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	linux-rtc@vger.kernel.org
Subject: Re: [PATCH] ARM: sunplus: use %pap to print resource_size_t
Date: Mon, 21 Nov 2022 15:10:13 +0100	[thread overview]
Message-ID: <0189f057-0433-4397-bb9a-f8fb76ab265b@app.fastmail.com> (raw)
In-Reply-To: <20221120003930.23846-1-rdunlap@infradead.org>

On Sun, Nov 20, 2022, at 01:39, Randy Dunlap wrote:
> Prevent a printk format warning by using %pap, which is designed for
> this purpose and can handle any size of resource_size_t.
>
> ../drivers/rtc/rtc-sunplus.c: In function 'sp_rtc_probe':
> ../drivers/rtc/rtc-sunplus.c:243:33: warning: format '%x' expects 
> argument of type 'unsigned int', but argument 4 has type 
> 'resource_size_t' {aka 'long long unsigned int'} [-Wformat=]
>   243 |         dev_dbg(&plat_dev->dev, "res = 0x%x, reg_base = 
> 0x%lx\n",
>
> Fixes: 0aa94eea8d95 ("ARM: sunplus: Add initial support for Sunplus SP7021 SoC")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Qin Jian <qinjian@cqplus1.com>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Vincent Shih <vincent.sunplus@gmail.com>
> Cc: Alessandro Zummo <a.zummo@towertech.it>
> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
> Cc: linux-rtc@vger.kernel.org

Acked-by: Arnd Bergmann <arnd@arndb.de>

>  	if (IS_ERR(sp_rtc->reg_base))
>  		return dev_err_probe(&plat_dev->dev, PTR_ERR(sp_rtc->reg_base),
>  					    "%s devm_ioremap_resource fail\n", RTC_REG_NAME);
> -	dev_dbg(&plat_dev->dev, "res = 0x%x, reg_base = 0x%lx\n",
> -		sp_rtc->res->start, (unsigned long)sp_rtc->reg_base);
> +	dev_dbg(&plat_dev->dev, "res = 0x%pap, reg_base = 0x%lx\n",
> +		&sp_rtc->res->start, (unsigned long)sp_rtc->reg_base);
> 

I would have picked %pr to print the resource, but hsi works as well.

      Arnd

      reply	other threads:[~2022-11-21 14:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-20  0:39 [PATCH] ARM: sunplus: use %pap to print resource_size_t Randy Dunlap
2022-11-21 14:10 ` Arnd Bergmann [this message]

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=0189f057-0433-4397-bb9a-f8fb76ab265b@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@bootlin.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=qinjian@cqplus1.com \
    --cc=rdunlap@infradead.org \
    --cc=vincent.sunplus@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).