]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: avoid unused variable warning in tcp_bpf_rtt()
authorArnd Bergmann <arnd@arndb.de>
Mon, 8 Jul 2019 12:57:21 +0000 (14:57 +0200)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 8 Jul 2019 15:18:03 +0000 (17:18 +0200)
commit921a7a569f54f7ee59fcefa7ec69e852dae359e2
tree8c8a032b8f5586f1a661847870ca6e60d5c9cf78
parent05b19ad3f69a90d827a59a4b3d9109b2db5834c2
bpf: avoid unused variable warning in tcp_bpf_rtt()

When CONFIG_BPF is disabled, we get a warning for an unused
variable:

In file included from drivers/target/target_core_device.c:26:
include/net/tcp.h:2226:19: error: unused variable 'tp' [-Werror,-Wunused-variable]
        struct tcp_sock *tp = tcp_sk(sk);

The variable is only used in one place, so it can be
replaced with its value there to avoid the warning.

Fixes: bf493185fee9 ("bpf: add BPF_CGROUP_SOCK_OPS callback that is executed on every RTT")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
include/net/tcp.h