Skip to content

Commit

Permalink
MIPS: OCTEON: Replace SIZEOF_FIELD() macro
Browse files Browse the repository at this point in the history
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: Pankaj Bharadiya <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Co-developed-by: Kees Cook <[email protected]>
Signed-off-by: Kees Cook <[email protected]>
  • Loading branch information
bpankajl authored and kees committed Dec 9, 2019
1 parent e42617b commit e437232
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions arch/mips/cavium-octeon/executive/cvmx-bootmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,6 @@ static struct cvmx_bootmem_desc *cvmx_bootmem_desc;

/* 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
* cvmx_bootmem_named_block_desc_t structure. These members can't
Expand All @@ -65,7 +58,7 @@ static struct cvmx_bootmem_desc *cvmx_bootmem_desc;
#define CVMX_BOOTMEM_NAMED_GET_FIELD(addr, field) \
__cvmx_bootmem_desc_get(addr, \
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
Expand Down

0 comments on commit e437232

Please sign in to comment.