diff options
author | Yonghong Song <yhs@fb.com> | 2021-11-12 23:48:33 +0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2021-11-13 01:11:46 +0300 |
commit | 21c6ec3d5275a77348b1af0e78cbbed0ee1558d4 (patch) | |
tree | 600349e7d24a866d8eae8cf6f7a2ac8fa0dca80e /tools | |
parent | 7cc595a60187bcfaf8a8013539900154eccb4d3f (diff) | |
download | linux-21c6ec3d5275a77348b1af0e78cbbed0ee1558d4.tar.xz |
selftests/bpf: Fix an unused-but-set-variable compiler warning
When using clang to build selftests with LLVM=1 in make commandline,
I hit the following compiler warning:
xdpxceiver.c:747:6: warning: variable 'total' set but not used [-Wunused-but-set-variable]
u32 total = 0;
^
This patch fixed the issue by removing that declaration and its
assocatied unused operation.
Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20211112204833.3579457-1-yhs@fb.com
Diffstat (limited to 'tools')
-rw-r--r-- | tools/testing/selftests/bpf/xdpxceiver.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/tools/testing/selftests/bpf/xdpxceiver.c b/tools/testing/selftests/bpf/xdpxceiver.c index 6c7cf8aadc79..fe7f423b8c3f 100644 --- a/tools/testing/selftests/bpf/xdpxceiver.c +++ b/tools/testing/selftests/bpf/xdpxceiver.c @@ -744,7 +744,6 @@ static void receive_pkts(struct pkt_stream *pkt_stream, struct xsk_socket_info * struct pkt *pkt = pkt_stream_get_next_rx_pkt(pkt_stream); struct xsk_umem_info *umem = xsk->umem; u32 idx_rx = 0, idx_fq = 0, rcvd, i; - u32 total = 0; int ret; while (pkt) { @@ -799,7 +798,6 @@ static void receive_pkts(struct pkt_stream *pkt_stream, struct xsk_socket_info * pthread_mutex_lock(&pacing_mutex); pkts_in_flight -= rcvd; - total += rcvd; if (pkts_in_flight < umem->num_frames) pthread_cond_signal(&pacing_cond); pthread_mutex_unlock(&pacing_mutex); |