summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorPali Rohár <pali@kernel.org>2022-02-03 19:51:37 +0100
committerTom Rini <trini@konsulko.com>2022-02-11 09:00:47 -0500
commiteebcdb34d06104ed9ad2f089ad8a0b4f3b8ec89e (patch)
tree16a1b44b87ac531f64b7d82a82dc7da7622f4688 /common
parent36fee2f7621eb2074be17bb0c4f8c950b0362c52 (diff)
downloadu-boot-eebcdb34d06104ed9ad2f089ad8a0b4f3b8ec89e.tar.gz
u-boot-eebcdb34d06104ed9ad2f089ad8a0b4f3b8ec89e.tar.bz2
u-boot-eebcdb34d06104ed9ad2f089ad8a0b4f3b8ec89e.zip
malloc_simple: Remove usage of unsupported %zx format string
Replace %zx by %lx and cast size_t to ulong. U-Boot currently prints garbage debug output: size=x, ptr=18, limit=18: 4002a000 With this change it prints correct debug data: size=18, ptr=18, limit=2000: 4002a000 Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common')
-rw-r--r--common/malloc_simple.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/malloc_simple.c b/common/malloc_simple.c
index 0267fb6bec..67ee623850 100644
--- a/common/malloc_simple.c
+++ b/common/malloc_simple.c
@@ -23,7 +23,7 @@ static void *alloc_simple(size_t bytes, int align)
addr = ALIGN(gd->malloc_base + gd->malloc_ptr, align);
new_ptr = addr + bytes - gd->malloc_base;
- log_debug("size=%zx, ptr=%lx, limit=%lx: ", bytes, new_ptr,
+ log_debug("size=%lx, ptr=%lx, limit=%lx: ", (ulong)bytes, new_ptr,
gd->malloc_limit);
if (new_ptr > gd->malloc_limit) {
log_err("alloc space exhausted\n");