From: Pierre Habouzit Date: Mon, 6 Oct 2008 09:38:59 +0000 (+0200) Subject: Add likely/unlikely macros. X-Git-Url: http://git.madism.org/?a=commitdiff_plain;h=92dc834e982d4b71ce6a3fcc2c973e555afd3fcf;p=apps%2Fpfixtools.git Add likely/unlikely macros. Signed-off-by: Pierre Habouzit --- 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) { \