[PATCH 1/1] global_data: fix type for gd_malloc_ptr()

Alexander Stein alexander.stein at ew.tq-group.com
Fri Jun 5 15:44:46 CEST 2026


With commit 92aa3ec321b5 ("global_data: Reduce size of early-malloc vars")
the type changes from (unsigned) long to int. But the type for default
if SYS_MALLOC_F_LEN is unset was not changed. Remove the suffix.
Fixes the warning:
 common/spl/spl.c:800:23: warning: format '%x' expects argument of type
 'unsigned int', but argument 2 has type 'long int' [-Wformat=]

Fixes: 92aa3ec321b5 ("global_data: Reduce size of early-malloc vars")
Signed-off-by: Alexander Stein <alexander.stein at ew.tq-group.com>
---
 include/asm-generic/global_data.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/asm-generic/global_data.h b/include/asm-generic/global_data.h
index 745d2c3a966..9d7146746d2 100644
--- a/include/asm-generic/global_data.h
+++ b/include/asm-generic/global_data.h
@@ -538,7 +538,7 @@ static_assert(sizeof(struct global_data) == GD_SIZE);
 #if CONFIG_VAL(SYS_MALLOC_F_LEN)
 #define gd_malloc_ptr()		gd->malloc_ptr
 #else
-#define gd_malloc_ptr()		0L
+#define gd_malloc_ptr()		0
 #endif
 
 #if CONFIG_IS_ENABLED(UPL)
-- 
2.54.0



More information about the U-Boot mailing list