]> xenbits.xensource.com Git - xen.git/commitdiff
xen: page_alloc: Don't open-code IS_ALIGNED()
authorJulien Grall <jgrall@amazon.com>
Wed, 20 Jul 2022 18:22:34 +0000 (19:22 +0100)
committerJulien Grall <jgrall@amazon.com>
Wed, 20 Jul 2022 18:26:19 +0000 (19:26 +0100)
init_heap_pages() is using an open-code version of IS_ALIGNED(). Replace
it to improve the readability of the code.

No functional change intended.

Signed-off-by: Julien Grall <jgrall@amazon.com>
Reviewed-by: Wei Chen <Wei.Chen@arm.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/common/page_alloc.c

index 6ca986584d31992117cbdd17b2395d897a72fb91..013f3d142eb27982090d98fccf4ce881c063f7db 100644 (file)
@@ -1827,7 +1827,7 @@ static void init_heap_pages(
             unsigned long s = mfn_x(page_to_mfn(pg + i));
             unsigned long e = mfn_x(mfn_add(page_to_mfn(pg + nr_pages - 1), 1));
             bool use_tail = (nid == phys_to_nid(pfn_to_paddr(e - 1))) &&
-                            !(s & ((1UL << MAX_ORDER) - 1)) &&
+                            IS_ALIGNED(s, 1UL << MAX_ORDER) &&
                             (find_first_set_bit(e) <= find_first_set_bit(s));
             unsigned long n;