https://github.com/torvalds/linux
Revision a7dcdf6ea1b264ee7655a8cafe844f06eed3906a authored by Arnd Bergmann on 20 February 2018, 22:07:33 UTC, committed by Daniel Borkmann on 22 February 2018, 00:11:20 UTC
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: b13d88072172 ("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>
1 parent cfd092f
History
Tip revision: a7dcdf6ea1b264ee7655a8cafe844f06eed3906a authored by Arnd Bergmann on 20 February 2018, 22:07:33 UTC
bpf: clean up unused-variable warning
Tip revision: a7dcdf6
File Mode Size
Documentation
LICENSES
arch
block
certs
crypto
drivers
firmware
fs
include
init
ipc
kernel
lib
mm
net
samples
scripts
security
sound
tools
usr
virt
.cocciconfig -rw-r--r-- 59 bytes
.get_maintainer.ignore -rw-r--r-- 31 bytes
.gitattributes -rw-r--r-- 30 bytes
.gitignore -rw-r--r-- 1.5 KB
.mailmap -rw-r--r-- 8.8 KB
COPYING -rw-r--r-- 18.3 KB
CREDITS -rw-r--r-- 96.2 KB
Kbuild -rw-r--r-- 2.2 KB
Kconfig -rw-r--r-- 287 bytes
MAINTAINERS -rw-r--r-- 435.1 KB
Makefile -rw-r--r-- 60.1 KB
README -rw-r--r-- 722 bytes

README

back to top