]> git.sesse.net Git - bcachefs-tools-debian/commitdiff
bcachefs-tools: Guard the __struct_group() #define in kernel.h
authorChris Webb <chris@arachsys.com>
Sat, 9 Dec 2023 14:15:08 +0000 (14:15 +0000)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 10 Dec 2023 04:28:58 +0000 (23:28 -0500)
Our include/linux/byteorder.h uses the system <asm/byteorder.h>
because we don't provide our own in include/asm. This then pulls in
system <linux/stddef.h> which defines __struct_group. That definition
collides with the unconditional #define __struct_group in our local
include/linux/kernel.h, provoking preprocessor warnings.

Signed-off-by: Chris Webb <chris@arachsys.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
include/linux/kernel.h

index 6315e53abcf7089dcd33a535099a952af82a756a..6f56748966cfaf8a89708cbcee0c056acd41a1c2 100644 (file)
        (type *)((char *)__mptr - offsetof(type, member)); })
 #endif
 
+#ifndef __struct_group
 #define __struct_group(TAG, NAME, ATTRS, MEMBERS...) \
        union { \
                struct { MEMBERS } ATTRS; \
                struct TAG { MEMBERS } ATTRS NAME; \
        }
+#endif
+
 #define struct_group(NAME, MEMBERS...) \
        __struct_group(/* no tag */, NAME, /* no attrs */, MEMBERS)