[xen master] efi: use ROUNDUP() macro instead of open code

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[xen master] efi: use ROUNDUP() macro instead of open code

patchbot
commit 3dec344d89cfe7ab62e680769e73f7975e122454
Author:     Daniel Kiper <[hidden email]>
AuthorDate: Tue Dec 5 17:16:04 2017 +0100
Commit:     Jan Beulich <[hidden email]>
CommitDate: Tue Dec 5 17:16:04 2017 +0100

    efi: use ROUNDUP() macro instead of open code
   
    Signed-off-by: Daniel Kiper <[hidden email]>
    Acked-by: Jan Beulich <[hidden email]>
---
 xen/common/efi/boot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 01d3300..469bf98 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -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");
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
[hidden email]
https://lists.xenproject.org/xen-changelog