Messages in this thread Patch in this message | | | From | Namhyung Kim <> | Subject | [PATCH 2/8] tools include: Define likely/unlikely in linux/compiler.h | Date | Thu, 9 Jan 2014 23:00:53 +0900 |
| |
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
| |