From 04a5b48902fa118ba8113ff9f915f48719a921ec Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Wed, 21 Jan 2015 17:37:34 +0100 Subject: [PATCH] Use ALIGN_UP instead of manual alignment BUG=none BRANCH=none TEST=none Change-Id: I56f357db6d37120772a03a1f7f84ce2a5b5620e9 Signed-off-by: Patrick Georgi Reviewed-on: https://chromium-review.googlesource.com/241855 Reviewed-by: Aaron Durbin Tested-by: Patrick Georgi Commit-Queue: Patrick Georgi Reviewed-on: http://review.coreboot.org/8396 Tested-by: build bot (Jenkins) --- payloads/libpayload/libc/malloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/payloads/libpayload/libc/malloc.c b/payloads/libpayload/libc/malloc.c index 1d99a9c4b6..edda0b424f 100644 --- a/payloads/libpayload/libc/malloc.c +++ b/payloads/libpayload/libc/malloc.c @@ -130,7 +130,7 @@ static void *alloc(int len, struct memory_type *type) hdrtype_t volatile *ptr = (hdrtype_t volatile *)type->start; /* Align the size. */ - len = (len + HDRSIZE - 1) & ~(HDRSIZE - 1); + len = ALIGN_UP(len, HDRSIZE); if (!len || len > MAX_SIZE) return (void *)NULL;