diff options
author | Jiapeng Chong <jiapeng.chong@linux.alibaba.com> | 2021-03-03 10:20:35 +0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2021-03-05 06:24:53 +0300 |
commit | 46ac034f769fcd50d3d554041a3879a0cdf2ee57 (patch) | |
tree | f31295878e123ad20e0057e8670aee185f9a7b04 /tools/bpf | |
parent | b0d3df486fcfb08810915c5fa95692cd8ec79298 (diff) | |
download | linux-46ac034f769fcd50d3d554041a3879a0cdf2ee57.tar.xz |
bpf: Simplify the calculation of variables
Fix the following coccicheck warnings:
./tools/bpf/bpf_dbg.c:1201:55-57: WARNING !A || A && B is equivalent to
!A || B.
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/1614756035-111280-1-git-send-email-jiapeng.chong@linux.alibaba.com
Diffstat (limited to 'tools/bpf')
-rw-r--r-- | tools/bpf/bpf_dbg.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/bpf/bpf_dbg.c b/tools/bpf/bpf_dbg.c index a07dfc479270..00e560a17baf 100644 --- a/tools/bpf/bpf_dbg.c +++ b/tools/bpf/bpf_dbg.c @@ -1198,7 +1198,7 @@ static int cmd_run(char *num) else return CMD_OK; bpf_reset(); - } while (pcap_next_pkt() && (!has_limit || (has_limit && ++i < pkts))); + } while (pcap_next_pkt() && (!has_limit || (++i < pkts))); rl_printf("bpf passes:%u fails:%u\n", pass, fail); |