diff mbox series

[1/1] bootcount: fix printf() code

Message ID 20220119003343.95620-1-heinrich.schuchardt@canonical.com
State Accepted
Commit 05ec899140d2f602544f9ec6aa753ab36feff0b0
Delegated to: Tom Rini
Headers show
Series [1/1] bootcount: fix printf() code | expand

Commit Message

Heinrich Schuchardt Jan. 19, 2022, 12:33 a.m. UTC
For printing phys_addr_t we should use %pa to avoid warning like:

drivers/bootcount/bootcount_syscon.c:110:17: note: in expansion of macro ‘dev_err’
  110 |                 dev_err(dev, "%s: Unsupported register size: %d\n", __func__,
      |                 ^~~~~~~

seen for sandbox_defconfig with CONFIG_PHYS_64BIT=y.

Cf. commit 1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t")

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
---
 drivers/bootcount/bootcount_syscon.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Simon Glass Jan. 27, 2022, 3:05 p.m. UTC | #1
On Tue, 18 Jan 2022 at 17:33, Heinrich Schuchardt
<heinrich.schuchardt@canonical.com> wrote:
>
> For printing phys_addr_t we should use %pa to avoid warning like:
>
> drivers/bootcount/bootcount_syscon.c:110:17: note: in expansion of macro ‘dev_err’
>   110 |                 dev_err(dev, "%s: Unsupported register size: %d\n", __func__,
>       |                 ^~~~~~~
>
> seen for sandbox_defconfig with CONFIG_PHYS_64BIT=y.
>
> Cf. commit 1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t")
>
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> ---
>  drivers/bootcount/bootcount_syscon.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>
Tom Rini Jan. 29, 2022, 6:49 p.m. UTC | #2
On Wed, Jan 19, 2022 at 01:33:43AM +0100, Heinrich Schuchardt wrote:

> For printing phys_addr_t we should use %pa to avoid warning like:
> 
> drivers/bootcount/bootcount_syscon.c:110:17: note: in expansion of macro ‘dev_err’
>   110 |                 dev_err(dev, "%s: Unsupported register size: %d\n", __func__,
>       |                 ^~~~~~~
> 
> seen for sandbox_defconfig with CONFIG_PHYS_64BIT=y.
> 
> Cf. commit 1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t")
> 
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/drivers/bootcount/bootcount_syscon.c b/drivers/bootcount/bootcount_syscon.c
index 413fd5bb9d..f80d87071d 100644
--- a/drivers/bootcount/bootcount_syscon.c
+++ b/drivers/bootcount/bootcount_syscon.c
@@ -107,8 +107,8 @@  static int bootcount_syscon_of_to_plat(struct udevice *dev)
 		return -EINVAL;
 	}
 	if (reg_size != 4) {
-		dev_err(dev, "%s: Unsupported register size: %d\n", __func__,
-			reg_size);
+		dev_err(dev, "%s: Unsupported register size: %pa\n", __func__,
+			&reg_size);
 		return -EINVAL;
 	}