From patchwork Tue Aug 8 17:28:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 9888857 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C8A0960363 for ; Tue, 8 Aug 2017 17:31:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B34DA288C3 for ; Tue, 8 Aug 2017 17:31:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A8099288DB; Tue, 8 Aug 2017 17:31:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 942512894A for ; Tue, 8 Aug 2017 17:31:07 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1df8Io-0006f9-O4; Tue, 08 Aug 2017 17:28:22 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1df8In-0006eX-16 for xen-devel@lists.xen.org; Tue, 08 Aug 2017 17:28:21 +0000 Received: from [193.109.254.147] by server-7.bemta-6.messagelabs.com id E8/88-03557-4B4F9895; Tue, 08 Aug 2017 17:28:20 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrFLMWRWlGSWpSXmKPExsXitHRDpO7mL52 RBrdvqlos+biYxYHR4+ju30wBjFGsmXlJ+RUJrBnP/39jLDjEXzF51la2BsZLPF2MnBwSAv4S vUs72EBsNgF9id0vPjGB2CIC6hKnOy6ydjFycTALLGKUuLZ8EgtIQljATOLX/LlgRSwCKhLnl t1jBrF5BTwlLvQsYIcYKidx/vhPsLiQgJrEtf5L7BA1ghInZz4Bm8MsICFx8MUL5gmM3LOQpG YhSS1gZFrFqFGcWlSWWqRrZKiXVJSZnlGSm5iZo2toYKaXm1pcnJiempOYVKyXnJ+7iREYDgx AsIPxz7KAQ4ySHExKorybtDsjhfiS8lMqMxKLM+KLSnNSiw8xynBwKEnwbvoMlBMsSk1PrUjL zAEGJkxagoNHSYT3Lkiat7ggMbc4Mx0idYpRl+PVhP/fmIRY8vLzUqXEeXNBigRAijJK8+BGw KLkEqOslDAvI9BRQjwFqUW5mSWo8q8YxTkYlYR5N4BM4cnMK4Hb9AroCCagIyJ8wY4oSURIST UwTl156uLue6FV8qUZZdcfXvuWtulgiMKEf5+T1xzjd1PTetNnWrjqtU18gqyBZ2DYH1txtU/ 9RVu3fTDQSZbYv0zv/JM7355L9CSxZGRKf+guOmQq7xgVz8uXmq99/bDK06p7Z90XsEbtkOJu ul66TZ3FU8Lwm05h8OqVHKy/uJZOllZo+DRTiaU4I9FQi7moOBEAbE6TG40CAAA= X-Env-Sender: prvs=38698410b=Andrew.Cooper3@citrix.com X-Msg-Ref: server-15.tower-27.messagelabs.com!1502213297!58048432!1 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 31727 invoked from network); 8 Aug 2017 17:28:19 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-15.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 8 Aug 2017 17:28:19 -0000 X-IronPort-AV: E=Sophos;i="5.41,344,1498521600"; d="scan'208";a="434749726" From: Andrew Cooper To: Xen-devel Date: Tue, 8 Aug 2017 18:28:09 +0100 Message-ID: <1502213289-18843-1-git-send-email-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 Cc: Andrew Cooper , Julien Grall , Stefano Stabellini , Jan Beulich Subject: [Xen-devel] [PATCH] common/page_alloc: Drop BOOT_BUG_ON() X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 Acked-by: Jan Beulich Acked-by: Julien Grall --- CC: Jan Beulich CC: Stefano Stabellini CC: Julien Grall --- xen/common/page_alloc.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c index 8bcef6a..64fe951 100644 --- a/xen/common/page_alloc.c +++ b/xen/common/page_alloc.c @@ -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(); }