Skip to content

Commit 9b87647

Browse files
evdenisarndb
authored andcommitted
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>
1 parent 602828c commit 9b87647

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎include/asm-generic/bug.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ void __warn(const char *file, int line, void *caller, unsigned taint,
185185
#endif
186186

187187
#ifndef HAVE_ARCH_BUG_ON
188-
#define BUG_ON(condition) do { if (condition) BUG(); } while (0)
188+
#define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0)
189189
#endif
190190

191191
#ifndef HAVE_ARCH_WARN_ON

0 commit comments

Comments
 (0)