From: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Date: Wed, 19 Jan 2022 00:33:43 +0000 (+0100)
Subject: bootcount: fix printf() code
X-Git-Tag: v2025.01-rc5-pxa1908~1560^2~8
X-Git-Url: http://git.dujemihanovic.xyz/img/static/git-favicon.png?a=commitdiff_plain;h=05ec899140d2f602544f9ec6aa753ab36feff0b0;p=u-boot.git

bootcount: fix printf() code

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>
---

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;
 	}