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)
This commit is contained in:
parent
f129756ac9
commit
04a5b48902
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue