]> xenbits.xensource.com Git - people/dariof/xen.git/commitdiff
x86/mm: don't check alloc_boot_pages return
authorJulien Grall <julien.grall@arm.com>
Wed, 16 Aug 2017 10:27:22 +0000 (12:27 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 16 Aug 2017 10:27:22 +0000 (12:27 +0200)
The only way alloc_boot_pages will return 0 is during the error case.
Although, Xen will panic in the error path. So the check in the caller
is pointless.

Looking at the loop, my understanding is it will try to allocate in
smaller chunk if a bigger chunk fail. Given that alloc_boot_pages can
never check, the loop seems unecessary.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/mm.c

index 5b863c6fa64c0b4ed0ba4678238f6d8a21ff4ce3..31fe8a1472d4d8748960effae2c85bd206000a94 100644 (file)
@@ -200,11 +200,7 @@ static void __init init_frametable_chunk(void *start, void *end)
          */
         while ( step && s + (step << PAGE_SHIFT) > e + (4 << PAGE_SHIFT) )
             step >>= PAGETABLE_ORDER;
-        do {
-            mfn = alloc_boot_pages(step, step);
-        } while ( !mfn && (step >>= PAGETABLE_ORDER) );
-        if ( !mfn )
-            panic("Not enough memory for frame table");
+        mfn = alloc_boot_pages(step, step);
         map_pages_to_xen(s, mfn, step, PAGE_HYPERVISOR);
     }