From patchwork Tue Jul 8 22:26:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: HIMANGI SARAOGI X-Patchwork-Id: 4510501 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BAABA9F1C4 for ; Tue, 8 Jul 2014 22:29:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 08128201EC for ; Tue, 8 Jul 2014 22:29:02 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4B941201DC for ; Tue, 8 Jul 2014 22:29:01 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1X4dqr-0004Fr-C9; Tue, 08 Jul 2014 22:27:05 +0000 Received: from mail-pa0-x232.google.com ([2607:f8b0:400e:c03::232]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1X4dqp-0004Bq-2s for linux-arm-kernel@lists.infradead.org; Tue, 08 Jul 2014 22:27:03 +0000 Received: by mail-pa0-f50.google.com with SMTP id bj1so8077319pad.37 for ; Tue, 08 Jul 2014 15:26:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=M5H6hkij0c8ZvrQFqw0lFjnBJdlj1iQ+Qj0Sl324nX4=; b=rnfAwceLgwZzuaLwvNl6Km64NwJX4+/bCo82ZK8WSLXv0SONQAViE3X4ErG9E7wYlL +Ujo5qwmfnwx8w2RnDnsdx5ozjixmyDggp92Jwu/VID/CEBif59U+pR3xwPQoXvbe+QB vd96TOuFDW6mTaabxyzQPMPlqA38AYcq6ku9JKbq/NYhfoaoyIGvO/OFQiqS3rAPzRU8 5d3gIyj5MvywMIPxiqkHnWsRpMHpwh2eL/E6wzQaDGoenydieeRUsB0dFQniXspjGDty a9o2PIFU1nWTg/sJ3glzfYM3cet5bhGl/jE+4BdE/I3epJ56xznyxwJq/PRWVafEDACy 5kHg== X-Received: by 10.69.26.68 with SMTP id iw4mr5504676pbd.137.1404858401603; Tue, 08 Jul 2014 15:26:41 -0700 (PDT) Received: from localhost ([182.65.208.116]) by mx.google.com with ESMTPSA id x5sm56842477pbw.26.2014.07.08.15.26.38 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 08 Jul 2014 15:26:40 -0700 (PDT) Date: Wed, 9 Jul 2014 03:56:34 +0530 From: Himangi Saraogi To: Stefano Stabellini , Russell King , xen-devel@lists.xenproject.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] xen/arm: use BUG_ON Message-ID: <20140708222634.GA11976@himangi-Dell> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140708_152703_147002_896F6E56 X-CRM114-Status: GOOD ( 12.63 ) X-Spam-Score: -0.6 (/) Cc: julia.lawall@lip6.fr X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use BUG_ON(x) rather than if(x) BUG(); The semantic patch that fixes this problem is as follows: // @@ identifier x; @@ -if (x) BUG(); +BUG_ON(x); // Signed-off-by: Himangi Saraogi Acked-by: Stefano Stabellini --- arch/arm/xen/enlighten.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c index 1e63243..98544c5 100644 --- a/arch/arm/xen/enlighten.c +++ b/arch/arm/xen/enlighten.c @@ -181,8 +181,7 @@ static void xen_restart(enum reboot_mode reboot_mode, const char *cmd) struct sched_shutdown r = { .reason = SHUTDOWN_reboot }; int rc; rc = HYPERVISOR_sched_op(SCHEDOP_shutdown, &r); - if (rc) - BUG(); + BUG_ON(rc); } static void xen_power_off(void) @@ -190,8 +189,7 @@ static void xen_power_off(void) struct sched_shutdown r = { .reason = SHUTDOWN_poweroff }; int rc; rc = HYPERVISOR_sched_op(SCHEDOP_shutdown, &r); - if (rc) - BUG(); + BUG_ON(rc); } static int xen_cpu_notification(struct notifier_block *self,