From 2cdb55a93f5dbf032fab0102758c40b08dc9dab8 Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Sat, 15 Aug 2015 11:53:01 +0200 Subject: Avoid re-defining macros * kern/macros.h: Avoid re-defining macros. * linux/src/include/linux/compiler-gcc.h: Likewise. * linux/src/include/linux/compiler.h: Likewise. --- linux/src/include/linux/compiler-gcc.h | 2 ++ linux/src/include/linux/compiler.h | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'linux/src') diff --git a/linux/src/include/linux/compiler-gcc.h b/linux/src/include/linux/compiler-gcc.h index 59e4028..b1a0be0 100644 --- a/linux/src/include/linux/compiler-gcc.h +++ b/linux/src/include/linux/compiler-gcc.h @@ -9,7 +9,9 @@ /* Optimization barrier */ /* The "volatile" is due to gcc bugs */ +#ifndef barrier #define barrier() __asm__ __volatile__("": : :"memory") +#endif /* barrier */ /* * This macro obfuscates arithmetic on a variable address so that gcc diff --git a/linux/src/include/linux/compiler.h b/linux/src/include/linux/compiler.h index 320d6c9..eb3dd94 100644 --- a/linux/src/include/linux/compiler.h +++ b/linux/src/include/linux/compiler.h @@ -143,8 +143,12 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); #endif /* CONFIG_PROFILE_ALL_BRANCHES */ #else -# define likely(x) __builtin_expect(!!(x), 1) -# define unlikely(x) __builtin_expect(!!(x), 0) +# ifndef likely +# define likely(x) __builtin_expect(!!(x), 1) +# endif /* likely */ +# ifndef unlikely +# define unlikely(x) __builtin_expect(!!(x), 0) +# endif /* unlikely */ #endif /* Optimization barrier */ -- cgit v1.2.3