Skip to content

Commit e437232

Browse files
bpankajlkees
authored andcommitted
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: 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]>
1 parent e42617b commit e437232

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

arch/mips/cavium-octeon/executive/cvmx-bootmem.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,6 @@ static struct cvmx_bootmem_desc *cvmx_bootmem_desc;
4444

4545
/* See header file for descriptions of functions */
4646

47-
/**
48-
* This macro returns the size of a member of a structure.
49-
* Logically it is the same as "sizeof(s::field)" in C++, but
50-
* C lacks the "::" operator.
51-
*/
52-
#define SIZEOF_FIELD(s, field) sizeof(((s *)NULL)->field)
53-
5447
/**
5548
* This macro returns a member of the
5649
* cvmx_bootmem_named_block_desc_t structure. These members can't
@@ -65,7 +58,7 @@ static struct cvmx_bootmem_desc *cvmx_bootmem_desc;
6558
#define CVMX_BOOTMEM_NAMED_GET_FIELD(addr, field) \
6659
__cvmx_bootmem_desc_get(addr, \
6760
offsetof(struct cvmx_bootmem_named_block_desc, field), \
68-
SIZEOF_FIELD(struct cvmx_bootmem_named_block_desc, field))
61+
sizeof_field(struct cvmx_bootmem_named_block_desc, field))
6962

7063
/**
7164
* This function is the implementation of the get macros defined

0 commit comments

Comments
 (0)