[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20180830223429.30051-4-igor.stoppa@huawei.com>
Date: Fri, 31 Aug 2018 01:34:09 +0300
From: Igor Stoppa <igor.stoppa@...il.com>
To: linux-kernel@...r.kernel.org
Cc: igor.stoppa@...il.com, Igor Stoppa <igor.stoppa@...wei.com>,
Arnd Bergmann <arnd@...db.de>
Subject: [PATCH 03/23] asm-generic: bug: add unlikely() to BUG_ON()
Add a hint to the compiler.
If BUG_ON() is used instead of BUG(), it means that probably the
preferred outcome is to not BUG().
Signed-off-by: Igor Stoppa <igor.stoppa@...wei.com>
Cc: Arnd Bergmann <arnd@...db.de>
---
include/asm-generic/bug.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h
index 20561a60db9c..34c48444c942 100644
--- a/include/asm-generic/bug.h
+++ b/include/asm-generic/bug.h
@@ -183,7 +183,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
--
2.17.1
Powered by blists - more mailing lists