diff options
-rw-r--r-- | include/linux/sizeof_field.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/linux/sizeof_field.h b/include/linux/sizeof_field.h index 7ff541cb21af..96aa05c90076 100644 --- a/include/linux/sizeof_field.h +++ b/include/linux/sizeof_field.h @@ -2,13 +2,16 @@ #ifndef _LINUX_SIZEOF_FIELD_H #define _LINUX_SIZEOF_FIELD_H +#include <linux/memberof.h> + + /** * sizeof_field() - Report the size of a struct field in bytes * * @TYPE: The structure containing the field of interest * @MEMBER: The field to return the size of */ -#define sizeof_field(TYPE, MEMBER) sizeof((((TYPE *)0)->MEMBER)) +#define sizeof_field(TYPE, MEMBER) sizeof(memberof(TYPE, MEMBER)) #endif /* _LINUX_SIZEOF_FIELD_H */ |