Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>

authored by

Arnd Bergmann and committed by
Boris Ostrovsky
fefcfb99 a0e4fd14

+5 -5
+5 -5
drivers/xen/pvcalls-back.c
··· 1098 1098 xenbus_switch_state(dev, XenbusStateClosing); 1099 1099 break; 1100 1100 default: 1101 - __WARN(); 1101 + WARN_ON(1); 1102 1102 } 1103 1103 break; 1104 1104 case XenbusStateInitWait: ··· 1113 1113 xenbus_switch_state(dev, XenbusStateClosing); 1114 1114 break; 1115 1115 default: 1116 - __WARN(); 1116 + WARN_ON(1); 1117 1117 } 1118 1118 break; 1119 1119 case XenbusStateConnected: ··· 1127 1127 xenbus_switch_state(dev, XenbusStateClosing); 1128 1128 break; 1129 1129 default: 1130 - __WARN(); 1130 + WARN_ON(1); 1131 1131 } 1132 1132 break; 1133 1133 case XenbusStateClosing: ··· 1138 1138 xenbus_switch_state(dev, XenbusStateClosed); 1139 1139 break; 1140 1140 default: 1141 - __WARN(); 1141 + WARN_ON(1); 1142 1142 } 1143 1143 break; 1144 1144 default: 1145 - __WARN(); 1145 + WARN_ON(1); 1146 1146 } 1147 1147 } 1148 1148 }