From 1d1e2ef6bf021b3948b5122d5a7e87e15dfbbdff Mon Sep 17 00:00:00 2001 From: Qu Wenruo Date: Thu, 16 Mar 2017 11:18:30 +0800 Subject: [PATCH] btrfs-progs: kerncompat: Fix re-definition of __bitwise In latest linux api headers, __bitwise is already defined in /usr/include/linux/types.h. So kerncompat.h will re-define __bitwise, and cause gcc warning. Fix it by checking if __bitwise is already define. Signed-off-by: Qu Wenruo Signed-off-by: David Sterba --- kerncompat.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kerncompat.h b/kerncompat.h index 958bea4..fa96715 100644 --- a/kerncompat.h +++ b/kerncompat.h @@ -317,11 +317,13 @@ static inline void assert_trace(const char *assertion, const char *filename, #define container_of(ptr, type, member) ({ \ const typeof( ((type *)0)->member ) *__mptr = (ptr); \ (type *)( (char *)__mptr - offsetof(type,member) );}) +#ifndef __bitwise #ifdef __CHECKER__ #define __bitwise __bitwise__ #else #define __bitwise -#endif +#endif /* __CHECKER__ */ +#endif /* __bitwise */ /* Alignment check */ #define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0) -- 2.7.4