diff mbox

[1/2] btrfs-progs: kerncompat: Fix re-definition of __bitwise

Message ID 20170316031831.28006-1-quwenruo@cn.fujitsu.com (mailing list archive)
State Accepted
Headers show

Commit Message

Qu Wenruo March 16, 2017, 3:18 a.m. UTC
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>
---
The patch is based on devel branch with the following head:
commit 64abe9f619b614e589339046b6c45dfb8fa8e2a9
Author: David Sterba <dsterba@suse.com>
Date:   Wed Mar 15 12:28:16 2017 +0100

    btrfs-progs: tests: misc/019, use fssum
---
 kerncompat.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

David Sterba March 27, 2017, 5:37 p.m. UTC | #1
On Thu, Mar 16, 2017 at 11:18:30AM +0800, Qu Wenruo wrote:
> 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>

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/kerncompat.h b/kerncompat.h
index 958bea43..fa96715f 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)