summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Webb <chris@arachsys.com>2023-12-09 14:15:08 +0000
committerKent Overstreet <kent.overstreet@linux.dev>2023-12-09 23:28:58 -0500
commit0d401928b876d75ea6f85a4e305f945d946adde4 (patch)
tree32984a0e8417c0ae2c8ba88b3bce12d3fbb37b5f
parent872cd437e7b5a15c928e094710a7022184ab0217 (diff)
bcachefs-tools: Guard the __struct_group() #define in kernel.h
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>
-rw-r--r--include/linux/kernel.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 6315e53a..6f567489 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -99,11 +99,14 @@
(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)