Commit e4372329 authored by Pankaj Bharadiya's avatar Pankaj Bharadiya Committed by Kees Cook

MIPS: OCTEON: Replace SIZEOF_FIELD() macro

Switch to the standard sizeof_field() macro to find the size of a member
of a struct and remove the custom SIZEOF_FIELD() macro.
Signed-off-by: default avatarPankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
Link: https://lore.kernel.org/r/20190924105839.110713-4-pankaj.laxminarayan.bharadiya@intel.comCo-developed-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
parent e42617b8
...@@ -44,13 +44,6 @@ static struct cvmx_bootmem_desc *cvmx_bootmem_desc; ...@@ -44,13 +44,6 @@ static struct cvmx_bootmem_desc *cvmx_bootmem_desc;
/* See header file for descriptions of functions */ /* See header file for descriptions of functions */
/**
* This macro returns the size of a member of a structure.
* Logically it is the same as "sizeof(s::field)" in C++, but
* C lacks the "::" operator.
*/
#define SIZEOF_FIELD(s, field) sizeof(((s *)NULL)->field)
/** /**
* This macro returns a member of the * This macro returns a member of the
* cvmx_bootmem_named_block_desc_t structure. These members can't * cvmx_bootmem_named_block_desc_t structure. These members can't
...@@ -65,7 +58,7 @@ static struct cvmx_bootmem_desc *cvmx_bootmem_desc; ...@@ -65,7 +58,7 @@ static struct cvmx_bootmem_desc *cvmx_bootmem_desc;
#define CVMX_BOOTMEM_NAMED_GET_FIELD(addr, field) \ #define CVMX_BOOTMEM_NAMED_GET_FIELD(addr, field) \
__cvmx_bootmem_desc_get(addr, \ __cvmx_bootmem_desc_get(addr, \
offsetof(struct cvmx_bootmem_named_block_desc, field), \ offsetof(struct cvmx_bootmem_named_block_desc, field), \
SIZEOF_FIELD(struct cvmx_bootmem_named_block_desc, field)) sizeof_field(struct cvmx_bootmem_named_block_desc, field))
/** /**
* This function is the implementation of the get macros defined * This function is the implementation of the get macros defined
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment