[ovs-dev] [PATCH V3 5/9] datapath: Use sizeof_field macro

Yi-Hung Wei yihung.wei at gmail.com
Fri Mar 6 18:51:49 UTC 2020


On Wed, Mar 4, 2020 at 3:04 PM Greg Rose <gvrose8192 at gmail.com> wrote:
>
> From: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya at intel.com>
>
> Upstream commit:
>     commit c593642c8be046915ca3a4a300243a68077cd207
>     Author: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya at intel.com>
>     Date:   Mon Dec 9 10:31:43 2019 -0800
>
>     treewide: Use sizeof_field() macro
>
>     Replace all the occurrences of FIELD_SIZEOF() with sizeof_field() except
>     at places where these are defined. Later patches will remove the unused
>     definition of FIELD_SIZEOF().
>
>     This patch is generated using following script:
>
>     EXCLUDE_FILES="include/linux/stddef.h|include/linux/kernel.h"
>
>     git grep -l -e "\bFIELD_SIZEOF\b" | while read file;
>     do
>
>         if [[ "$file" =~ $EXCLUDE_FILES ]]; then
>                 continue
>         fi
>         sed -i  -e 's/\bFIELD_SIZEOF\b/sizeof_field/g' $file;
>     done
>
>     Signed-off-by: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya at intel.com>
>     Link: https://lore.kernel.org/r/20190924105839.110713-3-pankaj.laxminarayan.bharadiya@intel.com
>     Co-developed-by: Kees Cook <keescook at chromium.org>
>     Signed-off-by: Kees Cook <keescook at chromium.org>
>     Acked-by: David Miller <davem at davemloft.net> # for net
>
> Also added a compatibility layer macro for older kernels that still
> use SIZEOF_FIELD
>
> Signed-off-by: Greg Rose <gvrose8192 at gmail.com>
> ---
> V3 - As suggested by Yi-Hung go ahead and just do the sizeof_field
>      backport rather than the cheap and easy way done in previous
>      versions of this patch.
> ---

Acked-by: Yi-Hung Wei <yihung.wei at gmail.com>


More information about the dev mailing list