summaryrefslogtreecommitdiff
path: root/tools/include/linux
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2023-02-23 11:16:39 +0300
committerIngo Molnar <mingo@kernel.org>2023-02-23 11:16:39 +0300
commit585a78c1f77be305b1f6adad392f16047fb66ffd (patch)
tree765143b487d582832c7695c9fbcae141c35baa4c /tools/include/linux
parent37064583f63eca93c98a9cdf2360485ea05f617a (diff)
parent69308402ca6f5b80a5a090ade0b13bd146891420 (diff)
downloadlinux-585a78c1f77be305b1f6adad392f16047fb66ffd.tar.xz
Merge branch 'linus' into objtool/core, to pick up Xen dependencies
Pick up dependencies - freshly merged upstream via xen-next - before applying dependent objtool changes. Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/include/linux')
-rw-r--r--tools/include/linux/build_bug.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/include/linux/build_bug.h b/tools/include/linux/build_bug.h
index cc7070c7439b..b4898ff085de 100644
--- a/tools/include/linux/build_bug.h
+++ b/tools/include/linux/build_bug.h
@@ -79,4 +79,13 @@
#define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
#endif // static_assert
+
+/*
+ * Compile time check that field has an expected offset
+ */
+#define ASSERT_STRUCT_OFFSET(type, field, expected_offset) \
+ BUILD_BUG_ON_MSG(offsetof(type, field) != (expected_offset), \
+ "Offset of " #field " in " #type " has changed.")
+
+
#endif /* _LINUX_BUILD_BUG_H */