Skip to contentSkip to conversation

btrfs-progs: avoid redefined __bitwise__ warning

PATCH In review Wang Yugui 3 participants 3 messages Aug 16, 2022 Btrfs file system

lore
Share & tools
lore

Wang Yugui

author
#0 lore raw

PATCH 1/1 btrfs-progs: avoid redefined __bitwise__ warning

compile warning:

    ./kerncompat.h:142: warning: "__bitwise__" redefined
    #define __bitwise__

    In file included from ./kerncompat.h:35,
                    from check/qgroup-verify.c:24:
    /usr/include/linux/types.h:25: note: this is the location of the previous definition
    #define __bitwise__ __bitwise

Because __bitwise__ is already defined in newer kernel-headers (/usr/include/linux/types.h), so add #ifndef to avoid this warning.

---
 kerncompat.h | 2 ++
 1 file changed, 2 insertions(+)
kerncompat.h +2 -0
index f6477990..15595500 100644
@@ -139,8 +139,10 @@ static inline void bugon_trace(const char *assertion, const char *filename,
 #define __bitwise__ __attribute__((bitwise))
 #else
 #define __force
+#ifndef __bitwise__
 #define __bitwise__
 #endif
+#endif
 
 #ifndef __CHECKER__
 /*
Signature · 1 line
2.36.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Wang Yugui

compile warning:

     ./kerncompat.h:142: warning: "__bitwise__" redefined
     #define __bitwise__

     In file included from ./kerncompat.h:35,
                     from check/qgroup-verify.c:24:
     /usr/include/linux/types.h:25: note: this is the location of the previous definition
     #define __bitwise__ __bitwise
Quoted 4 lines

Because __bitwise__ is already defined in newer kernel-headers (/usr/include/linux/types.h), so add #ifndef to avoid this warning.

Thanks,
Qu

Quoted 19 lines
---
  kerncompat.h | 2 ++
  1 file changed, 2 insertions(+)
kerncompat.h +2 -0
index f6477990..15595500 100644
@@ -139,8 +139,10 @@ static inline void bugon_trace(const char *assertion, const char *filename,
  #define __bitwise__ __attribute__((bitwise))
  #else
  #define __force
+#ifndef __bitwise__
  #define __bitwise__
  #endif
+#endif
 
  #ifndef __CHECKER__
  /*
#2 lore raw
In reply to Wang Yugui
Quoted 9 lines · Wang Yugui

compile warning:

    ./kerncompat.h:142: warning: "__bitwise__" redefined
    #define __bitwise__

    In file included from ./kerncompat.h:35,
                    from check/qgroup-verify.c:24:
    /usr/include/linux/types.h:25: note: this is the location of the previous definition
    #define __bitwise__ __bitwise
Quoted 4 lines

Because __bitwise__ is already defined in newer kernel-headers (/usr/include/linux/types.h), so add #ifndef to avoid this warning.

Added to devel, thanks.