Skip to contentSkip to conversation

efi: use ROUNDUP() macro instead of open code

PATCH In review Daniel Kiper 2 participants 2 messages Dec 4, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 efi: use ROUNDUP() macro instead of open code

---
 xen/common/efi/boot.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/common/efi/boot.c +1 -1
index 01d3300..469bf98 100644
@@ -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");
Signature · 7 lines
1.7.10.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel