summaryrefslogtreecommitdiff
path: root/payloads
diff options
context:
space:
mode:
authorPatrick Georgi <pgeorgi@google.com>2015-01-21 17:37:34 +0100
committerPatrick Georgi <pgeorgi@google.com>2015-02-12 15:52:01 +0100
commit04a5b48902fa118ba8113ff9f915f48719a921ec (patch)
treee6e15c996fc4971d21c8555b4b90d8de742dc21b /payloads
parentf129756ac95bf7accd1e840bea882f1b6edac8af (diff)
Use ALIGN_UP instead of manual alignment
BUG=none BRANCH=none TEST=none Change-Id: I56f357db6d37120772a03a1f7f84ce2a5b5620e9 Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: https://chromium-review.googlesource.com/241855 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Tested-by: Patrick Georgi <pgeorgi@chromium.org> Commit-Queue: Patrick Georgi <pgeorgi@chromium.org> Reviewed-on: http://review.coreboot.org/8396 Tested-by: build bot (Jenkins)
Diffstat (limited to 'payloads')
-rw-r--r--payloads/libpayload/libc/malloc.c2
1 files changed, 1 insertions, 1 deletions
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;