Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1715352pxb; Thu, 4 Feb 2021 22:31:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJywNTfEOwvmUM88u5Riza75sHcmlaY6oryoa+Bj+zjZdlPKkyxc7KYGqK6lt4hncd0leYHX X-Received: by 2002:a17:906:3899:: with SMTP id q25mr2595363ejd.173.1612506673344; Thu, 04 Feb 2021 22:31:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612506673; cv=none; d=google.com; s=arc-20160816; b=qEIQBnqiSMPBXlQD57dD3ATstWNbAuwAFRC+VvG1ECqBet9Ox16TA1m7u94WejhklG nFGwqpaRIzpaYqFydUeeF1cljPXQoDYonK4zTRNXZjzedwMQWto5dUHrschyh+xxTldS rCunMLYqRuQaWjcLADk+3/JZylYODzLgEytNm34uBbk7bBpKXxPDXS6v+dnEwvtzyTqA 7UcRJU29Qdbok5t5AyrHepCCjVoSAfWaYuBpL1+BX7TDa+XRxyvnyeBAB5/itVlQMd5h 2O4Jn4yr/q2u5Btea8qLR1tUcJmqt5K1RYZma92uP06YSsvDFkotW3BT3FrWfIpYaSQ4 rOdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=LxcRzXBH72+MbSStJJkupregAQZiDETyx36aLef1Z1w=; b=TwhflVNpo/fBMlx7MYev2UIaN9vN6RkPcWNx6i/dGuGcvuMcHAyOtUbcuW5LDDhwa+ qqvJeHQLVVGw1afJ5lJeMtNiV2cp0TP/Q0iZUwBMZkxCVsp7xlIuUBal8UiLlL/X/TSm 5HSCp/HOJRDICPUTMUnemPkAAjDAEXHdXUTivSgmL+Oy60+lH/Aa06akvBnvc0U7rftV z5lcdC9qvec6BhUKWB401t1pwuYy5y3vWZ3y0yGthuMPyGg6vdd+4GFfq+lRO2400AWq RMkJ4pyzNF9dVhStH4+KCHX6j18vUHK1Ek9EQzfqMXoHT598S6G5jlGrAlej20WiVtr8 rW4w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v4si4617426edy.79.2021.02.04.22.30.49; Thu, 04 Feb 2021 22:31:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231148AbhBEG2m (ORCPT + 99 others); Fri, 5 Feb 2021 01:28:42 -0500 Received: from out30-56.freemail.mail.aliyun.com ([115.124.30.56]:60124 "EHLO out30-56.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229492AbhBEG2j (ORCPT ); Fri, 5 Feb 2021 01:28:39 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R921e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04426;MF=jiapeng.chong@linux.alibaba.com;NM=1;PH=DS;RN=17;SR=0;TI=SMTPD_---0UNwRPr4_1612506441; Received: from j63c13417.sqa.eu95.tbsite.net(mailfrom:jiapeng.chong@linux.alibaba.com fp:SMTPD_---0UNwRPr4_1612506441) by smtp.aliyun-inc.com(127.0.0.1); Fri, 05 Feb 2021 14:27:46 +0800 From: Jiapeng Chong To: ast@kernel.org Cc: daniel@iogearbox.net, davem@davemloft.net, kuba@kernel.org, hawk@kernel.org, john.fastabend@gmail.com, shuah@kernel.org, andrii@kernel.org, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, kpsingh@kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Jiapeng Chong Subject: [PATCH] selftests/bpf: Simplify the calculation of variables Date: Fri, 5 Feb 2021 14:27:19 +0800 Message-Id: <1612506439-56810-1-git-send-email-jiapeng.chong@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix the following coccicheck warnings: ./tools/testing/selftests/bpf/xdpxceiver.c:954:28-30: WARNING !A || A && B is equivalent to !A || B. ./tools/testing/selftests/bpf/xdpxceiver.c:932:28-30: WARNING !A || A && B is equivalent to !A || B. ./tools/testing/selftests/bpf/xdpxceiver.c:909:28-30: WARNING !A || A && B is equivalent to !A || B. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong --- tools/testing/selftests/bpf/xdpxceiver.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/bpf/xdpxceiver.c b/tools/testing/selftests/bpf/xdpxceiver.c index 1e722ee..98ad4a2 100644 --- a/tools/testing/selftests/bpf/xdpxceiver.c +++ b/tools/testing/selftests/bpf/xdpxceiver.c @@ -906,7 +906,7 @@ static void *worker_testapp_validate(void *arg) ksft_print_msg("Destroying socket\n"); } - if (!opt_bidi || (opt_bidi && bidi_pass)) { + if (!opt_bidi || bidi_pass) { xsk_socket__delete(((struct ifobject *)arg)->xsk->xsk); (void)xsk_umem__delete(((struct ifobject *)arg)->umem->umem); } @@ -929,7 +929,7 @@ static void testapp_validate(void) pthread_mutex_lock(&sync_mutex); /*Spawn RX thread */ - if (!opt_bidi || (opt_bidi && !bidi_pass)) { + if (!opt_bidi || !bidi_pass) { if (pthread_create(&t0, &attr, worker_testapp_validate, (void *)ifdict[1])) exit_with_error(errno); } else if (opt_bidi && bidi_pass) { @@ -951,7 +951,7 @@ static void testapp_validate(void) pthread_mutex_unlock(&sync_mutex); /*Spawn TX thread */ - if (!opt_bidi || (opt_bidi && !bidi_pass)) { + if (!opt_bidi || !bidi_pass) { if (pthread_create(&t1, &attr, worker_testapp_validate, (void *)ifdict[0])) exit_with_error(errno); } else if (opt_bidi && bidi_pass) { -- 1.8.3.1