lkml.org 
[lkml]   [2014]   [Jan]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/8] tools include: Define likely/unlikely in linux/compiler.h
Date
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
tools/include/linux/compiler.h | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/tools/include/linux/compiler.h b/tools/include/linux/compiler.h
index 0135ccf2a00c..fbc6665c6d53 100644
--- a/tools/include/linux/compiler.h
+++ b/tools/include/linux/compiler.h
@@ -27,4 +27,12 @@
# define __weak __attribute__((weak))
#endif

+#ifndef likely
+# define likely(x) __builtin_expect(!!(x), 1)
+#endif
+
+#ifndef unlikely
+# define unlikely(x) __builtin_expect(!!(x), 0)
+#endif
+
#endif /* _TOOLS_LINUX_COMPILER_H */
--
1.7.9.2


\
 
 \ /
  Last update: 2014-01-09 15:41    [W:0.081 / U:0.708 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site