[coreboot-gerrit] New patch to review for coreboot: aea71b4 Use ALIGN_UP instead of manual alignment

Paul Menzel (paulepanter@users.sourceforge.net) gerrit at coreboot.org
Mon Feb 9 23:09:40 CET 2015


Paul Menzel (paulepanter at users.sourceforge.net) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/8396

-gerrit

commit aea71b43c96a8ba2022bca4ce17a5ff16c4cc780
Author: Patrick Georgi <pgeorgi at google.com>
Date:   Wed Jan 21 17:37:34 2015 +0100

    Use ALIGN_UP instead of manual alignment
    
    BUG=none
    BRANCH=none
    TEST=none
    
    Change-Id: I56f357db6d37120772a03a1f7f84ce2a5b5620e9
    Signed-off-by: Patrick Georgi <pgeorgi at google.com>
    Reviewed-on: https://chromium-review.googlesource.com/241855
    Reviewed-by: Aaron Durbin <adurbin at chromium.org>
    Tested-by: Patrick Georgi <pgeorgi at chromium.org>
    Commit-Queue: Patrick Georgi <pgeorgi at chromium.org>
---
 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 1d99a9c..edda0b4 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;



More information about the coreboot-gerrit mailing list