aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/asm-generic/bug.h
diff options
context:
space:
mode:
authorDenis Efremov <efremov@linux.com>2019-08-29 00:09:34 +0300
committerArnd Bergmann <arnd@arndb.de>2019-09-01 23:53:39 +0200
commit9b87647c665dbf93173ca2f43986902b59dfbbba (patch)
tree7c8d0697d6718fad3ffde8bd3e2cb41eaf118ecd /include/asm-generic/bug.h
parent__div64_const32(): improve the generic C version (diff)
downloadwireguard-linux-9b87647c665dbf93173ca2f43986902b59dfbbba.tar.xz
wireguard-linux-9b87647c665dbf93173ca2f43986902b59dfbbba.zip
asm-generic: add unlikely to default BUG_ON(x)
Add unlikely to default BUG_ON(x) in !CONFIG_BUG. It makes the define consistent with BUG_ON(x) in CONFIG_BUG. Signed-off-by: Denis Efremov <efremov@linux.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: <linux-arch@vger.kernel.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'include/asm-generic/bug.h')
-rw-r--r--include/asm-generic/bug.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h
index aa6c093d9ce9..7357a3c942a0 100644
--- a/include/asm-generic/bug.h
+++ b/include/asm-generic/bug.h
@@ -185,7 +185,7 @@ void __warn(const char *file, int line, void *caller, unsigned taint,
#endif
#ifndef HAVE_ARCH_BUG_ON
-#define BUG_ON(condition) do { if (condition) BUG(); } while (0)
+#define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0)
#endif
#ifndef HAVE_ARCH_WARN_ON