[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <0189f057-0433-4397-bb9a-f8fb76ab265b@app.fastmail.com>
Date: Mon, 21 Nov 2022 15:10:13 +0100
From: "Arnd Bergmann" <arnd@...db.de>
To: "Randy Dunlap" <rdunlap@...radead.org>,
linux-kernel@...r.kernel.org
Cc: "Qin Jian" <qinjian@...lus1.com>,
"Vincent Shih" <vincent.sunplus@...il.com>,
"Alessandro Zummo" <a.zummo@...ertech.it>,
"Alexandre Belloni" <alexandre.belloni@...tlin.com>,
linux-rtc@...r.kernel.org
Subject: Re: [PATCH] ARM: sunplus: use %pap to print resource_size_t
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@...radead.org>
> Cc: Qin Jian <qinjian@...lus1.com>
> Cc: Arnd Bergmann <arnd@...db.de>
> Cc: Vincent Shih <vincent.sunplus@...il.com>
> Cc: Alessandro Zummo <a.zummo@...ertech.it>
> Cc: Alexandre Belloni <alexandre.belloni@...tlin.com>
> Cc: linux-rtc@...r.kernel.org
Acked-by: Arnd Bergmann <arnd@...db.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
Powered by blists - more mailing lists