[PATCH 2/3] keymile: common: Fix pram variable radix

Niel Fourie lusus at denx.de
Fri Jan 8 11:53:09 CET 2021


In set_km_env() the pram variable was set to an hexadecimal value,
while initr_mem() expects an unsigned decimal. Set the pram variable
to an unsigned decimal instead.

Signed-off-by: Niel Fourie <lusus at denx.de>
Cc: Holger Brunck <holger.brunck at hitachi-powergrids.com>
Cc: Heiko Schocher <hs at denx.de>
Cc: Priyanka Jain <priyanka.jain at nxp.com>
---
 board/keymile/common/common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c
index 03c7ce9da7..106787efd5 100644
--- a/board/keymile/common/common.c
+++ b/board/keymile/common/common.c
@@ -60,7 +60,7 @@ int set_km_env(void)
 		strict_strtoul(p, 16, &rootfssize);
 	pram = (rootfssize + CONFIG_KM_RESERVED_PRAM + CONFIG_KM_PHRAM +
 		CONFIG_KM_PNVRAM) / 0x400;
-	sprintf((char *)buf, "0x%x", pram);
+	sprintf((char *)buf, "%u", pram);
 	env_set("pram", (char *)buf);
 
 	varaddr = gd->ram_size - CONFIG_KM_RESERVED_PRAM - CONFIG_KM_PHRAM;
-- 
2.29.2



More information about the U-Boot mailing list