diff options
author | Andrii Nakryiko <[email protected]> | 2021-03-13 13:09:19 -0800 |
---|---|---|
committer | Alexei Starovoitov <[email protected]> | 2021-03-16 12:26:49 -0700 |
commit | 105b842ba4ef2ddc287645cb33f90b960c16075b (patch) | |
tree | aef07129a6876cee43548b03b211c1224f808e3a /tools/perf/scripts/python/event_analyzing_sample.py | |
parent | 4bbb3583687051ef99966ddaeb1730441b777d40 (diff) |
selftests/bpf: Fix maybe-uninitialized warning in xdpxceiver test
xsk_ring_prod__reserve() doesn't necessarily set idx in some conditions, so
from static analysis point of view compiler is right about the problems like:
In file included from xdpxceiver.c:92:
xdpxceiver.c: In function ‘xsk_populate_fill_ring’:
/data/users/andriin/linux/tools/testing/selftests/bpf/tools/include/bpf/xsk.h:119:20: warning: ‘idx’ may be used uninitialized in this function [-Wmaybe-uninitialized]
return &addrs[idx & fill->mask];
~~~~^~~~~~~~~~~~
xdpxceiver.c:300:6: note: ‘idx’ was declared here
u32 idx;
^~~
xdpxceiver.c: In function ‘tx_only’:
xdpxceiver.c:596:30: warning: ‘idx’ may be used uninitialized in this function [-Wmaybe-uninitialized]
struct xdp_desc *tx_desc = xsk_ring_prod__tx_desc(&xsk->tx, idx + i);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Fix two warnings reported by compiler by pre-initializing variable.
Signed-off-by: Andrii Nakryiko <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/perf/scripts/python/event_analyzing_sample.py')
0 files changed, 0 insertions, 0 deletions