]> git.baikalelectronics.ru Git - kernel.git/commit
skbuff: Move conditional preprocessor directives out of struct sk_buff
authorKees Cook <keescook@chromium.org>
Sun, 21 Nov 2021 00:31:48 +0000 (16:31 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 22 Nov 2021 15:13:54 +0000 (15:13 +0000)
commit74aed197e87befc688d36a9241769de59043e487
treef6711038ddfc05da565be7bcef2561bb45c1a6cc
parent0d228dcbaf2ec8842c21fe7814aa2c0050d8d53f
skbuff: Move conditional preprocessor directives out of struct sk_buff

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.html

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/skbuff.h
net/core/filter.c