summaryrefslogtreecommitdiff
path: root/include/linux/stddef.h
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2022-01-13 14:33:02 -0500
committerTom Rini <trini@konsulko.com>2022-01-13 14:33:02 -0500
commit25711b07ca1dcf73dc41b45ca040dadbcff0fa08 (patch)
treede49c129e19ab9b129aca41d59cd8ecdc3e18de7 /include/linux/stddef.h
parent743c562d0c5269740236864bdb0002e73ec3e614 (diff)
parent6c9e3d1fc085977b5b38dfe610f65d1a7f48081b (diff)
Merge tag 'dm-pull-13jan22' of https://source.denx.de/u-boot/custodians/u-boot-dm
bloblist prep for standard passage switch order of pinctrl and power domain calls various minor fixes
Diffstat (limited to 'include/linux/stddef.h')
-rw-r--r--include/linux/stddef.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/linux/stddef.h b/include/linux/stddef.h
index c540f6100d4..a7f546fdfe5 100644
--- a/include/linux/stddef.h
+++ b/include/linux/stddef.h
@@ -1,6 +1,8 @@
#ifndef _LINUX_STDDEF_H
#define _LINUX_STDDEF_H
+#include <linux/compiler_types.h>
+
#undef NULL
#if defined(__cplusplus)
#define NULL 0
@@ -14,7 +16,11 @@
#ifndef __CHECKER__
#undef offsetof
-#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
+#ifdef __compiler_offsetof
+#define offsetof(TYPE, MEMBER) __compiler_offsetof(TYPE, MEMBER)
+#else
+#define offsetof(TYPE, MEMBER) ((size_t)&((TYPE *)0)->MEMBER)
+#endif
#endif
#endif