bpf, tcp: Fix unused function warnings
authorYueHaibing <yuehaibing@huawei.com>
Fri, 20 Mar 2020 02:34:25 +0000 (10:34 +0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 20 Mar 2020 14:56:25 +0000 (15:56 +0100)
commita26527981af2988ae0f17f6d633848c019929e38
tree10a827647d6e091d2091c075073bd1b71cd9cb1c
parent65c93628599dff4cd7cfb70130d1f6a2203731ea
bpf, tcp: Fix unused function warnings

If BPF_STREAM_PARSER is not set, gcc warns:

  net/ipv4/tcp_bpf.c:483:12: warning: 'tcp_bpf_sendpage' defined but not used [-Wunused-function]
  net/ipv4/tcp_bpf.c:395:12: warning: 'tcp_bpf_sendmsg' defined but not used [-Wunused-function]
  net/ipv4/tcp_bpf.c:13:13: warning: 'tcp_bpf_stream_read' defined but not used [-Wunused-function]

Moves the unused functions into the #ifdef CONFIG_BPF_STREAM_PARSER.

Fixes: f747632b608f ("bpf: sockmap: Move generic sockmap hooks from BPF TCP")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Lorenz Bauer <lmb@cloudflare.com>
Reviewed-by: Jakub Sitnicki <jakub@cloudflare.com>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20200320023426.60684-2-yuehaibing@huawei.com
net/ipv4/tcp_bpf.c