All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xen/arm: use BUG_ON
@ 2014-07-08 22:26 ` Himangi Saraogi
  0 siblings, 0 replies; 6+ messages in thread
From: Himangi Saraogi @ 2014-07-08 22:26 UTC (permalink / raw)
  To: Stefano Stabellini, Russell King, xen-devel, linux-arm-kernel,
	linux-kernel
  Cc: julia.lawall

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>
---
 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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH] xen/arm: use BUG_ON
@ 2014-07-08 22:26 ` Himangi Saraogi
  0 siblings, 0 replies; 6+ messages in thread
From: Himangi Saraogi @ 2014-07-08 22:26 UTC (permalink / raw)
  To: linux-arm-kernel

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>
---
 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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] xen/arm: use BUG_ON
  2014-07-08 22:26 ` Himangi Saraogi
@ 2014-07-09 10:49   ` Stefano Stabellini
  -1 siblings, 0 replies; 6+ messages in thread
From: Stefano Stabellini @ 2014-07-09 10:49 UTC (permalink / raw)
  To: Himangi Saraogi
  Cc: Stefano Stabellini, Russell King, xen-devel, linux-arm-kernel,
	linux-kernel, julia.lawall, David Vrabel

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
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] xen/arm: use BUG_ON
@ 2014-07-09 10:49   ` Stefano Stabellini
  0 siblings, 0 replies; 6+ messages in thread
From: Stefano Stabellini @ 2014-07-09 10:49 UTC (permalink / raw)
  To: linux-arm-kernel

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
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] xen/arm: use BUG_ON
  2014-07-08 22:26 ` Himangi Saraogi
  (?)
  (?)
@ 2014-07-09 10:49 ` Stefano Stabellini
  -1 siblings, 0 replies; 6+ messages in thread
From: Stefano Stabellini @ 2014-07-09 10:49 UTC (permalink / raw)
  To: Himangi Saraogi
  Cc: Russell King, Stefano Stabellini, linux-kernel, julia.lawall,
	David Vrabel, xen-devel, linux-arm-kernel

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
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] xen/arm: use BUG_ON
@ 2014-07-08 22:26 Himangi Saraogi
  0 siblings, 0 replies; 6+ messages in thread
From: Himangi Saraogi @ 2014-07-08 22:26 UTC (permalink / raw)
  To: Stefano Stabellini, Russell King, xen-devel, linux-arm-kernel,
	linux-kernel
  Cc: julia.lawall

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>
---
 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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-07-09 10:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-08 22:26 [PATCH] xen/arm: use BUG_ON Himangi Saraogi
2014-07-08 22:26 ` Himangi Saraogi
2014-07-09 10:49 ` Stefano Stabellini
2014-07-09 10:49   ` Stefano Stabellini
2014-07-09 10:49 ` Stefano Stabellini
  -- strict thread matches above, loose matches on Subject: below --
2014-07-08 22:26 Himangi Saraogi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.