Commit a91c7775 authored by Himangi Saraogi's avatar Himangi Saraogi Committed by Konrad Rzeszutek Wilk

xen/arm: use BUG_ON

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: default avatarHimangi Saraogi <himangi774@gmail.com>
Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: default avatarStefano Stabellini <stefano.stabellini@eu.citrix.com>
parent 438b33c7
...@@ -181,8 +181,7 @@ static void xen_restart(enum reboot_mode reboot_mode, const char *cmd) ...@@ -181,8 +181,7 @@ static void xen_restart(enum reboot_mode reboot_mode, const char *cmd)
struct sched_shutdown r = { .reason = SHUTDOWN_reboot }; struct sched_shutdown r = { .reason = SHUTDOWN_reboot };
int rc; int rc;
rc = HYPERVISOR_sched_op(SCHEDOP_shutdown, &r); rc = HYPERVISOR_sched_op(SCHEDOP_shutdown, &r);
if (rc) BUG_ON(rc);
BUG();
} }
static void xen_power_off(void) static void xen_power_off(void)
...@@ -190,8 +189,7 @@ static void xen_power_off(void) ...@@ -190,8 +189,7 @@ static void xen_power_off(void)
struct sched_shutdown r = { .reason = SHUTDOWN_poweroff }; struct sched_shutdown r = { .reason = SHUTDOWN_poweroff };
int rc; int rc;
rc = HYPERVISOR_sched_op(SCHEDOP_shutdown, &r); rc = HYPERVISOR_sched_op(SCHEDOP_shutdown, &r);
if (rc) BUG_ON(rc);
BUG();
} }
static int xen_cpu_notification(struct notifier_block *self, static int xen_cpu_notification(struct notifier_block *self,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment