diff options
| author | Thomas Zimmermann <tzimmermann@suse.de> | 2023-01-19 10:56:12 +0100 |
|---|---|---|
| committer | Thomas Zimmermann <tzimmermann@suse.de> | 2023-01-19 10:56:12 +0100 |
| commit | 6f84981772535e670e4e2df051a672af229b6694 (patch) | |
| tree | 407cec2ba38b75fc2a1bdefae5b6d3c6405be435 /include/linux/build_bug.h | |
| parent | cba83c1fc38612c3d2c7b1bfed9d882e4848fb0d (diff) | |
| parent | 0b45ac1170ea6416bc1d36798414c04870cd356d (diff) | |
| download | linux-next-6f84981772535e670e4e2df051a672af229b6694.tar.gz linux-next-6f84981772535e670e4e2df051a672af229b6694.zip | |
Merge drm/drm-next into drm-misc-next
Backmerging into drm-misc-next to get DRM accelerator infrastructure,
which is required by ipuv driver.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Diffstat (limited to 'include/linux/build_bug.h')
| -rw-r--r-- | include/linux/build_bug.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/build_bug.h b/include/linux/build_bug.h index e3a0be2c90ad..3aa3640f8c18 100644 --- a/include/linux/build_bug.h +++ b/include/linux/build_bug.h @@ -77,4 +77,13 @@ #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr) #define __static_assert(expr, msg, ...) _Static_assert(expr, msg) + +/* + * 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 */ |
