public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: stefano.stabellini@eu.citrix.com (Stefano Stabellini)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] xen/arm: use BUG_ON
Date: Wed, 9 Jul 2014 11:49:19 +0100	[thread overview]
Message-ID: <alpine.DEB.2.02.1407091148530.27641@kaball.uk.xensource.com> (raw)
In-Reply-To: <20140708222634.GA11976@himangi-Dell>

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@gmail.com>

Acked-by: Stefano Stabellini <stefano.stabellini@eu.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
> 

      reply	other threads:[~2014-07-09 10:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-08 22:26 [PATCH] xen/arm: use BUG_ON Himangi Saraogi
2014-07-09 10:49 ` Stefano Stabellini [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.02.1407091148530.27641@kaball.uk.xensource.com \
    --to=stefano.stabellini@eu.citrix.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox