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 <quwenruo@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Qu Wenruo 2017-03-16 11:18:30 +08:00 committed by David Sterba
parent c3d38a1880
commit 1d1e2ef6bf
1 changed files with 3 additions and 1 deletions

View 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)