提交 eebcdb34 编写于 作者: P Pali Rohár 提交者: Tom Rini

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: NPali Rohár <pali@kernel.org>
Reviewed-by: NSimon Glass <sjg@chromium.org>
上级 36fee2f7
......@@ -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");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册