linux/stddef.h: Add sizeof_member() macro
At present we have 2 different macros to calculate the size of a member of a struct: FIELD_SIZEOF() and sizeof_field(). As a prerequisite to bringing uniformity to the entire kernel source tree, add sizeof_member() macro as it is both more pleasant (not upper case) and more correct (sizeof()-family cannot operate on bit fields; this is meant to operate on struct members), as discussed[1]. Future patches will replace all occurrences of above macros with sizeof_member(). [1] https://www.openwall.com/lists/kernel-hardening/2019/07/02/2 Signed-off-by:Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com> Link: https://lore.kernel.org/r/20190924105839.110713-2-pankaj.laxminarayan.bharadiya@intel.com Co-developed-by:
Kees Cook <keescook@chromium.org> Signed-off-by:
Kees Cook <keescook@chromium.org>
Loading
Please sign in to comment