summaryrefslogtreecommitdiff
path: root/payloads/libpayload/libc/malloc.c
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2016-05-19 13:15:16 -0700
committerPatrick Georgi <pgeorgi@google.com>2019-04-10 10:42:45 +0000
commitf5b76fe9e9dc179cc0e29f724d132e530f88b401 (patch)
tree907c3ce978dc5fe83c965e02e84e4be710a442b6 /payloads/libpayload/libc/malloc.c
parent651d8dd4f6562e1176d87b7dfe7210507a622f55 (diff)
libpayload: Fix CONFIG_LP_DEBUG_MALLOC for 64-bit archs
New compilers are a little more stringent about defining the same prototype more than once, so some of our CONFIG_LP_DEBUG_MALLOC wrappers don't quite work the way they are written anymore. Also, several of the printf()s weren't written 64-bit safe. And let's add some double-evaluation safety while I'm here anyway... and I have no idea why this ever depended on CONFIG_LP_USB, that just seems like a typo. Change-Id: Ib54ebc3cfba99f372690365b78c7ceb372c0bd45 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/14921 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Diffstat (limited to 'payloads/libpayload/libc/malloc.c')
-rw-r--r--payloads/libpayload/libc/malloc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/payloads/libpayload/libc/malloc.c b/payloads/libpayload/libc/malloc.c
index 957f0e07b0..510758970e 100644
--- a/payloads/libpayload/libc/malloc.c
+++ b/payloads/libpayload/libc/malloc.c
@@ -480,7 +480,7 @@ look_further:
if ((reg->alignment == align) && (reg->free >= (size + align - 1)/align))
{
#if CONFIG(LP_DEBUG_MALLOC)
- printf(" found memalign region. %x free, %x required\n", reg->free, (size + align - 1)/align);
+ printf(" found memalign region. %u free, %zu required\n", reg->free, (size + align - 1)/align);
#endif
break;
}
@@ -563,7 +563,7 @@ again:
/* FIXME: Verify the size of the block. */
- printf("%s %x: %s (%x bytes)\n", type->name,
+ printf("%s %x: %s (%llx bytes)\n", type->name,
(unsigned int)(ptr - type->start),
hdr & FLAG_FREE ? "FREE" : "USED", SIZE(hdr));
@@ -575,7 +575,7 @@ again:
if (free_memory && (type->minimal_free > free_memory))
type->minimal_free = free_memory;
- printf("%s: Maximum memory consumption: %u bytes\n", type->name,
+ printf("%s: Maximum memory consumption: %zu bytes\n", type->name,
(type->end - type->start) - HDRSIZE - type->minimal_free);
if (type != dma) {