Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1693830 > unrolled thread

[PATCH] xen/pvcalls: use WARN_ON(1) instead of __WARN()

Started byArnd Bergmann <arnd@arndb.de>
First post2017-07-21 18:20 +0200
Last post2017-07-21 21:30 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] xen/pvcalls: use WARN_ON(1) instead of __WARN() Arnd Bergmann <arnd@arndb.de> - 2017-07-21 18:20 +0200
    Re: [PATCH] xen/pvcalls: use WARN_ON(1) instead of __WARN() Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2017-07-21 20:30 +0200
    Re: [PATCH] xen/pvcalls: use WARN_ON(1) instead of __WARN() Stefano Stabellini <sstabellini@kernel.org> - 2017-07-21 21:30 +0200

#1693830 — [PATCH] xen/pvcalls: use WARN_ON(1) instead of __WARN()

FromArnd Bergmann <arnd@arndb.de>
Date2017-07-21 18:20 +0200
Subject[PATCH] xen/pvcalls: use WARN_ON(1) instead of __WARN()
Message-ID<u5IOK-73n-23@gated-at.bofh.it>
__WARN() is an internal helper that is only available on
some architectures, but causes a build error e.g. on ARM64
in some configurations:

drivers/xen/pvcalls-back.c: In function 'set_backend_state':
drivers/xen/pvcalls-back.c:1097:5: error: implicit declaration of function '__WARN' [-Werror=implicit-function-declaration]

Unfortunately, there is no equivalent of BUG() that takes no
arguments, but WARN_ON(1) is commonly used in other drivers
and works on all configurations.

Fixes: 7160378206b2 ("xen/pvcalls: xenbus state handling")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/xen/pvcalls-back.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/xen/pvcalls-back.c b/drivers/xen/pvcalls-back.c
index d6c4c4aecb41..00c1a2344330 100644
--- a/drivers/xen/pvcalls-back.c
+++ b/drivers/xen/pvcalls-back.c
@@ -1094,7 +1094,7 @@ static void set_backend_state(struct xenbus_device *dev,
 				xenbus_switch_state(dev, XenbusStateClosing);
 				break;
 			default:
-				__WARN();
+				WARN_ON(1);
 			}
 			break;
 		case XenbusStateInitWait:
@@ -1109,7 +1109,7 @@ static void set_backend_state(struct xenbus_device *dev,
 				xenbus_switch_state(dev, XenbusStateClosing);
 				break;
 			default:
-				__WARN();
+				WARN_ON(1);
 			}
 			break;
 		case XenbusStateConnected:
@@ -1123,7 +1123,7 @@ static void set_backend_state(struct xenbus_device *dev,
 				xenbus_switch_state(dev, XenbusStateClosing);
 				break;
 			default:
-				__WARN();
+				WARN_ON(1);
 			}
 			break;
 		case XenbusStateClosing:
@@ -1134,11 +1134,11 @@ static void set_backend_state(struct xenbus_device *dev,
 				xenbus_switch_state(dev, XenbusStateClosed);
 				break;
 			default:
-				__WARN();
+				WARN_ON(1);
 			}
 			break;
 		default:
-			__WARN();
+			WARN_ON(1);
 		}
 	}
 }
-- 
2.9.0

[toc] | [next] | [standalone]


#1693910

FromBoris Ostrovsky <boris.ostrovsky@oracle.com>
Date2017-07-21 20:30 +0200
Message-ID<u5KQx-8gx-9@gated-at.bofh.it>
In reply to#1693830
On 07/21/2017 12:17 PM, Arnd Bergmann wrote:
> __WARN() is an internal helper that is only available on
> some architectures, but causes a build error e.g. on ARM64
> in some configurations:
>
> drivers/xen/pvcalls-back.c: In function 'set_backend_state':
> drivers/xen/pvcalls-back.c:1097:5: error: implicit declaration of function '__WARN' [-Werror=implicit-function-declaration]
>
> Unfortunately, there is no equivalent of BUG() that takes no
> arguments, but WARN_ON(1) is commonly used in other drivers
> and works on all configurations.
>
> Fixes: 7160378206b2 ("xen/pvcalls: xenbus state handling")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>

[toc] | [prev] | [next] | [standalone]


#1693935

FromStefano Stabellini <sstabellini@kernel.org>
Date2017-07-21 21:30 +0200
Message-ID<u5LMB-ou-11@gated-at.bofh.it>
In reply to#1693830
On Fri, 21 Jul 2017, Arnd Bergmann wrote:
> __WARN() is an internal helper that is only available on
> some architectures, but causes a build error e.g. on ARM64
> in some configurations:
> 
> drivers/xen/pvcalls-back.c: In function 'set_backend_state':
> drivers/xen/pvcalls-back.c:1097:5: error: implicit declaration of function '__WARN' [-Werror=implicit-function-declaration]
> 
> Unfortunately, there is no equivalent of BUG() that takes no
> arguments, but WARN_ON(1) is commonly used in other drivers
> and works on all configurations.
> 
> Fixes: 7160378206b2 ("xen/pvcalls: xenbus state handling")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
>  drivers/xen/pvcalls-back.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/xen/pvcalls-back.c b/drivers/xen/pvcalls-back.c
> index d6c4c4aecb41..00c1a2344330 100644
> --- a/drivers/xen/pvcalls-back.c
> +++ b/drivers/xen/pvcalls-back.c
> @@ -1094,7 +1094,7 @@ static void set_backend_state(struct xenbus_device *dev,
>  				xenbus_switch_state(dev, XenbusStateClosing);
>  				break;
>  			default:
> -				__WARN();
> +				WARN_ON(1);
>  			}
>  			break;
>  		case XenbusStateInitWait:
> @@ -1109,7 +1109,7 @@ static void set_backend_state(struct xenbus_device *dev,
>  				xenbus_switch_state(dev, XenbusStateClosing);
>  				break;
>  			default:
> -				__WARN();
> +				WARN_ON(1);
>  			}
>  			break;
>  		case XenbusStateConnected:
> @@ -1123,7 +1123,7 @@ static void set_backend_state(struct xenbus_device *dev,
>  				xenbus_switch_state(dev, XenbusStateClosing);
>  				break;
>  			default:
> -				__WARN();
> +				WARN_ON(1);
>  			}
>  			break;
>  		case XenbusStateClosing:
> @@ -1134,11 +1134,11 @@ static void set_backend_state(struct xenbus_device *dev,
>  				xenbus_switch_state(dev, XenbusStateClosed);
>  				break;
>  			default:
> -				__WARN();
> +				WARN_ON(1);
>  			}
>  			break;
>  		default:
> -			__WARN();
> +			WARN_ON(1);
>  		}
>  	}
>  }
> -- 
> 2.9.0
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web