• Kees Cook's avatar
    skbuff: Move conditional preprocessor directives out of struct sk_buff · fba84957
    Kees Cook authored
    In preparation for using the struct_group() macro in struct sk_buff,
    move the conditional preprocessor directives out of the region of struct
    sk_buff that will be enclosed by struct_group(). While GCC and Clang are
    happy with conditional preprocessor directives here, sparse is not, even
    under -Wno-directive-within-macro[1], as would be seen under a C=1 build:
    
    net/core/filter.c: note: in included file (through include/linux/netlink.h, include/linux/sock_diag.h):
    ./include/linux/skbuff.h:820:1: warning: directive in macro's argument list
    ./include/linux/skbuff.h:822:1: warning: directive in macro's argument list
    ./include/linux/skbuff.h:846:1: warning: directive in macro's argument list
    ./include/linux/skbuff.h:848:1: warning: directive in macro's argument list
    
    Additionally remove empty macro argument definitions and usage.
    
    "objdump -d" shows no object code differences.
    
    [1] https://www.spinics.net/lists/linux-sparse/msg10857.htmlSigned-off-by: default avatarKees Cook <keescook@chromium.org>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    fba84957
filter.c 291 KB