btrfs-progs: kerncompat: Fix re-definition of __bitwise
authorQu Wenruo <quwenruo@cn.fujitsu.com>
Thu, 16 Mar 2017 03:18:30 +0000 (11:18 +0800)
committerDavid Sterba <dsterba@suse.com>
Thu, 16 Mar 2017 16:40:35 +0000 (17:40 +0100)
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 <quwenruo@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
kerncompat.h

index 958bea4..fa96715 100644 (file)
@@ -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)