Skip to contentSkip to conversation

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

PATCH Applied Arnd Bergmann 3 participants 6 messages Jul 21, 2017 – Aug 16, 2017 Xen hypervisor interface

lore
Share & tools
lore
#0 lore raw

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

__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")
---
 drivers/xen/pvcalls-back.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/xen/pvcalls-back.c +5 -5
index d6c4c4aecb41..00c1a2344330 100644
@@ -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);
 		}
 	}
 }
Signature · 7 lines
2.9.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Arnd Bergmann

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

Quoted 6 lines

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

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

maintainer Reviewed-by on v1 1/1
#2 lore raw
In reply to Arnd Bergmann
Quoted 7 lines · Arnd Bergmann

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

Quoted 6 lines

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")
Quoted 52 lines
---
 drivers/xen/pvcalls-back.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/xen/pvcalls-back.c +5 -5
index d6c4c4aecb41..00c1a2344330 100644
@@ -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);
 		}
 	}
 }
Signature · 1 line
2.9.0
#3 lore raw
Quoted 8 lines · Stefano Stabellini
Quoted 7 lines · Arnd Bergmann

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

Quoted 8 lines
Quoted 6 lines

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

Applied to for-linus-4.14

-boris

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#4 lore raw
In reply to Stefano Stabellini
Quoted 8 lines · Stefano Stabellini
Quoted 7 lines · Arnd Bergmann

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

Quoted 8 lines
Quoted 6 lines

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

Applied to for-linus-4.14

-boris

maintainer Reviewed-by on v1 1/1
#5 lore raw
In reply to Arnd Bergmann
Quoted 7 lines · Arnd Bergmann

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

Quoted 6 lines

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")
Quoted 52 lines
---
 drivers/xen/pvcalls-back.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/xen/pvcalls-back.c +5 -5
index d6c4c4aecb41..00c1a2344330 100644
@@ -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);
 		}
 	}
 }
Signature · 1 line
2.9.0

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel