]> xenbits.xensource.com Git - people/iwj/xen.git/commitdiff
efi: use ROUNDUP() macro instead of open code
authorDaniel Kiper <daniel.kiper@oracle.com>
Tue, 5 Dec 2017 16:16:04 +0000 (17:16 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 5 Dec 2017 16:16:04 +0000 (17:16 +0100)
Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/common/efi/boot.c

index 01d33004e069e73cb217e9df0b4513843853b73a..469bf980cc666d3e9eca5fc92b25d480ad1ea8ab 100644 (file)
@@ -176,7 +176,7 @@ static void __init __maybe_unused *ebmalloc(size_t size)
 {
     void *ptr = ebmalloc_mem + ebmalloc_allocated;
 
-    ebmalloc_allocated += (size + sizeof(void *) - 1) & ~(sizeof(void *) - 1);
+    ebmalloc_allocated += ROUNDUP(size, sizeof(void *));
 
     if ( ebmalloc_allocated > sizeof(ebmalloc_mem) )
         blexit(L"Out of static memory\r\n");