From 92dc834e982d4b71ce6a3fcc2c973e555afd3fcf Mon Sep 17 00:00:00 2001 From: Pierre Habouzit Date: Mon, 6 Oct 2008 11:38:59 +0200 Subject: [PATCH] Add likely/unlikely macros. Signed-off-by: Pierre Habouzit --- common/common.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/common.h b/common/common.h index 30ce1d8..896eacc 100644 --- a/common/common.h +++ b/common/common.h @@ -70,6 +70,9 @@ typedef void (*exitcall_t)(void); #define module_init(fn) static __init initcall_t __init_##fn = fn; #define module_exit(fn) static __exit exitcall_t __exit_##fn = fn; +#define likely(expr) __builtin_expect((expr) != 0, 1) +#define unlikely(expr) __builtin_expect((expr) != 0, 0) + #define __log(Level, Fmt, ...) \ if (log_level >= Level) { \ if (log_syslog) { \ -- 2.20.1