Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <pankaj.laxminarayan.bharadiya@intel.com>
Link: https://lore.kernel.org/r/20190924105839.110713-4-pankaj.laxminarayan.bharadiya@intel.com
Co-developed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Kees Cook <keescook@chromium.org>

authored by

Pankaj Bharadiya and committed by
Kees Cook
e4372329 e42617b8

+1 -8
+1 -8
arch/mips/cavium-octeon/executive/cvmx-bootmem.c
··· 45 45 /* See header file for descriptions of functions */ 46 46 47 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 - 54 - /** 55 48 * This macro returns a member of the 56 49 * cvmx_bootmem_named_block_desc_t structure. These members can't 57 50 * be directly addressed as they might be in memory not directly ··· 58 65 #define CVMX_BOOTMEM_NAMED_GET_FIELD(addr, field) \ 59 66 __cvmx_bootmem_desc_get(addr, \ 60 67 offsetof(struct cvmx_bootmem_named_block_desc, field), \ 61 - SIZEOF_FIELD(struct cvmx_bootmem_named_block_desc, field)) 68 + sizeof_field(struct cvmx_bootmem_named_block_desc, field)) 62 69 63 70 /** 64 71 * This function is the implementation of the get macros defined