Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1023732pxb; Thu, 4 Mar 2021 00:54:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJxo1crGR7odaSqFKEMoX5guAlPgP7X7pIf0Pgc0MA5YrVJ3RcsB9m+6CiXwFzKTcC2Nf2C2 X-Received: by 2002:a17:906:9442:: with SMTP id z2mr3245136ejx.79.1614848083257; Thu, 04 Mar 2021 00:54:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614848083; cv=none; d=google.com; s=arc-20160816; b=vq5QE8/BiuaDUR/3Lm/tGWl8IqkMcrFBFlUWL45w1UfixXdH3bYNjldoqMUROMZdYN HdshW1/3iVDmjznTIxlcRyoHa5KKqW9IUXUEcaHB2p4jN+hH+F0mri/lpZrnppdwWiN+ A634Nfvkdl5p9Bjm0Nn2BWjqaKuQZ+npMFHjUxd/1SssVt2MD5jggDzSgmJjuRlpAmdl P7396P7l3OoxDyuWWFHMmxtBfs77nt1o090YBG9FEA6eXx4yXAvaPYVL1GhPmp3SQiD0 rpau6LZnpMDADM3aTFKt4aJ7kzugYRSOREfkF8+Pu/aqsZqtEYQ5bHcreVQ+AdJDnxGw Dawg== 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=7DldJQRfjpsNbAcTi+lLHBdKcg+Aag2QX25tgzTeGmU=; b=K/1yPbuVKxwyz/LjTk+LPbAd6CFVxJdC3SsjNSq4FBlP8r49o32bqWg4L7AukwfwB+ 7AZL1ak+b+CSxO/2HUGzvWSbwk0DWMrJba2omap2EqfMWEAnbq1eplCKywMrZvNGeHlj RNPIjbCzww/E/6yIuVQadeqxMmm3WdkDU0OcS3ziLUNxZFsSoulInh4WR+0tjYkzKt2T 4AUHHt8EWRpB352JQuZWOfSQiRjeeMC5dgIqC4CEW6LiXRMVo0RnjyqJZswA3wgyfBeD lhwWxFgloxR/1A5DamPETtLyGmeDN2bZvFiHKBRDRHUycLFbLEE6jSbLG2BlZobo05Po KATA== 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 v7si17845499edj.572.2021.03.04.00.54.20; Thu, 04 Mar 2021 00:54:43 -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 S1380407AbhCCMbJ (ORCPT + 99 others); Wed, 3 Mar 2021 07:31:09 -0500 Received: from out30-56.freemail.mail.aliyun.com ([115.124.30.56]:49938 "EHLO out30-56.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346340AbhCCHVd (ORCPT ); Wed, 3 Mar 2021 02:21:33 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R201e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e01424;MF=jiapeng.chong@linux.alibaba.com;NM=1;PH=DS;RN=12;SR=0;TI=SMTPD_---0UQBUUCk_1614756040; Received: from j63c13417.sqa.eu95.tbsite.net(mailfrom:jiapeng.chong@linux.alibaba.com fp:SMTPD_---0UQBUUCk_1614756040) by smtp.aliyun-inc.com(127.0.0.1); Wed, 03 Mar 2021 15:20:48 +0800 From: Jiapeng Chong To: ast@kernel.org Cc: daniel@iogearbox.net, andrii@kernel.org, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org, Jiapeng Chong Subject: [PATCH] bpf: Simplify the calculation of variables Date: Wed, 3 Mar 2021 15:20:35 +0800 Message-Id: <1614756035-111280-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/bpf/bpf_dbg.c:1201:55-57: WARNING !A || A && B is equivalent to !A || B. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong --- tools/bpf/bpf_dbg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/bpf/bpf_dbg.c b/tools/bpf/bpf_dbg.c index a07dfc4..00e560a 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); -- 1.8.3.1