[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.02.1407091148530.27641@kaball.uk.xensource.com>
Date: Wed, 9 Jul 2014 11:49:19 +0100
From: Stefano Stabellini <stefano.stabellini@...citrix.com>
To: Himangi Saraogi <himangi774@...il.com>
CC: Stefano Stabellini <stefano.stabellini@...citrix.com>,
Russell King <linux@....linux.org.uk>,
<xen-devel@...ts.xenproject.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>, <julia.lawall@...6.fr>,
David Vrabel <david.vrabel@...rix.com>
Subject: Re: [PATCH] xen/arm: use BUG_ON
On Wed, 9 Jul 2014, Himangi Saraogi wrote:
> Use BUG_ON(x) rather than if(x) BUG();
>
> The semantic patch that fixes this problem is as follows:
>
> // <smpl>
> @@ identifier x; @@
> -if (x) BUG();
> +BUG_ON(x);
> // </smpl>
>
> Signed-off-by: Himangi Saraogi <himangi774@...il.com>
Acked-by: Stefano Stabellini <stefano.stabellini@...citrix.com>
> 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,
> --
> 1.9.1
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists