]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: clean up unused-variable warning
authorArnd Bergmann <arnd@arndb.de>
Tue, 20 Feb 2018 22:07:33 +0000 (23:07 +0100)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 22 Feb 2018 00:11:20 +0000 (01:11 +0100)
commit92f159b79aeca2bb1d22601dc87ef39ae41981f2
tree04e12e0ba1e022228abb6b07df11fd7dcdac0e35
parentf36ff77ade3923dedd6be21995dd312e9ffa8170
bpf: clean up unused-variable warning

The only user of this variable is inside of an #ifdef, causing
a warning without CONFIG_INET:

net/core/filter.c: In function '____bpf_sock_ops_cb_flags_set':
net/core/filter.c:3382:6: error: unused variable 'val' [-Werror=unused-variable]
  int val = argval & BPF_SOCK_OPS_ALL_CB_FLAGS;

This replaces the #ifdef with a nicer IS_ENABLED() check that
makes the code more readable and avoids the warning.

Fixes: b6aff82de244 ("bpf: Adds field bpf_sock_ops_cb_flags to tcp_sock")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
net/core/filter.c