]> xenbits.xensource.com Git - people/andrewcoop/xen.git/commitdiff
common/page_alloc: Drop BOOT_BUG_ON()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 8 Aug 2017 10:47:07 +0000 (11:47 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 9 Aug 2017 10:23:16 +0000 (11:23 +0100)
Regular BUG_ON()'s work fine by this point on all architectures, so drop the
custom infrastructure.  Substitute BUG_ON(1) for BUG().

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Julien Grall <julien.grall@arm.com>
xen/common/page_alloc.c

index 8bcef6a547aa059f6685b1af9c19421bb84b1c0b..64fe951e8dc3147cc97060eedafc0f1eeebdd28c 100644 (file)
@@ -203,12 +203,6 @@ struct scrub_region {
 static struct scrub_region __initdata region[MAX_NUMNODES];
 static unsigned long __initdata chunk_size;
 
-static void __init boot_bug(int line)
-{
-    panic("Boot BUG at %s:%d", __FILE__, line);
-}
-#define BOOT_BUG_ON(p) if ( p ) boot_bug(__LINE__);
-
 static void __init bootmem_region_add(unsigned long s, unsigned long e)
 {
     unsigned int i;
@@ -223,9 +217,8 @@ static void __init bootmem_region_add(unsigned long s, unsigned long e)
         if ( s < bootmem_region_list[i].e )
             break;
 
-    BOOT_BUG_ON((i < nr_bootmem_regions) && (e > bootmem_region_list[i].s));
-    BOOT_BUG_ON(nr_bootmem_regions ==
-                (PAGE_SIZE / sizeof(struct bootmem_region)));
+    BUG_ON((i < nr_bootmem_regions) && (e > bootmem_region_list[i].s));
+    BUG_ON(nr_bootmem_regions == (PAGE_SIZE / sizeof(struct bootmem_region)));
 
     memmove(&bootmem_region_list[i+1], &bootmem_region_list[i],
             (nr_bootmem_regions - i) * sizeof(*bootmem_region_list));
@@ -328,7 +321,7 @@ unsigned long __init alloc_boot_pages(
     unsigned long pg, _e;
     unsigned int i = nr_bootmem_regions;
 
-    BOOT_BUG_ON(!nr_bootmem_regions);
+    BUG_ON(!nr_bootmem_regions);
 
     while ( i-- )
     {
@@ -362,8 +355,7 @@ unsigned long __init alloc_boot_pages(
         return pg;
     }
 
-    BOOT_BUG_ON(1);
-    return 0;
+    BUG();
 }