]> git.baikalelectronics.ru Git - kernel.git/commitdiff
selftests/bpf: Simplify the calculation of variables
authorJiapeng Chong <jiapeng.chong@linux.alibaba.com>
Wed, 3 Mar 2021 07:52:10 +0000 (15:52 +0800)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 5 Mar 2021 03:25:31 +0000 (19:25 -0800)
Fix the following coccicheck warnings:

./tools/testing/selftests/bpf/test_sockmap.c:735:35-37: 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/1614757930-17197-1-git-send-email-jiapeng.chong@linux.alibaba.com
tools/testing/selftests/bpf/test_sockmap.c

index 427ca00a32177a2b48b3c2e590e414aabf0bc69f..eefd445b96fc7263d743a4fbc0715db0dd63ee69 100644 (file)
@@ -732,7 +732,7 @@ static int sendmsg_test(struct sockmap_options *opt)
                 * socket is not a valid test. So in this case lets not
                 * enable kTLS but still run the test.
                 */
-               if (!txmsg_redir || (txmsg_redir && txmsg_ingress)) {
+               if (!txmsg_redir || txmsg_ingress) {
                        err = sockmap_init_ktls(opt->verbose, rx_fd);
                        if (err)
                                return err;