Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2974959pxu; Mon, 14 Dec 2020 16:35:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJynYAwZt3jnkYINqG77dIjOhSdnSXhjwMHKukjOEP+aQcx3RnEH6fAQIXfgrB2ETFr+B8bp X-Received: by 2002:a17:906:7784:: with SMTP id s4mr24811860ejm.93.1607992543202; Mon, 14 Dec 2020 16:35:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607992543; cv=none; d=google.com; s=arc-20160816; b=fDyPZOBVXrENCdixlR7c3mioKOgGMAHsjC6wyrIf41ROJR036hb+AW96P4ySkiJPmR j1pJrEa5LoDkhRCOe70dW5KmXHeNLHMr8opOeCC9wb4JiE4BvPe6LB4bw9iP1WDBWx9s sJ5C84bHdK8deZY5LgcgQIZBsQ2FzfXKsRfcAg8O+36Q+pp/sAicZieF+z4BUKFHFACe IZjpGWJQsW/cDj5VSwiqVaaPM9VJ7doFRqaYhGkOa0VZ1v5VKnXetGKlMdE0/YOADRHi rcXnOMBKsheTBBQO0TRTWG+NOcLmfPaSePbzpyqoXe/o/U+Z7GIE62MAmICXJOFs5dK7 bcXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=Tyd17nabybtauxQCGnZlN0AU1VCngok7vqytOBlsUvQ=; b=QIObyBTEK8JFr02iktTbT+RtyN8nO1nGm/HBrdOxw9hgcVIVTP2T5sYSegHZMJOLXf wyEVsbGwxmhSalRDVxvu48W7Bv7vduxviEDUnAdUiGRjwVu14Xm0TPtCfKY4TXTe2DQ5 0RFeyCwlKjOyWKm/X1rJL7Yh8aEAaON05JpEtfSJd+hgebdBI8f8U3LSM+pobuVWg/5W GJkicioA2jH/03OPO6FZbf4XbzX7naI/dMdTFN6AJYGFJ2teIOFyNsHP0HE2f4/+hjUQ X/FJb7xECcy9o8E8akiC/Sg560jw2UgcT+48Nmve9KtHH2KnJCRu+fV0dyaS69aIr7bB 3CbA== 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=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bu13si56453ejb.588.2020.12.14.16.35.20; Mon, 14 Dec 2020 16:35: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=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727935AbgLOABd (ORCPT + 99 others); Mon, 14 Dec 2020 19:01:33 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:41073 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726618AbgLOABX (ORCPT ); Mon, 14 Dec 2020 19:01:23 -0500 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1koxla-0004B0-LB; Tue, 15 Dec 2020 00:00:34 +0000 From: Colin King To: Yisen Zhuang , Salil Mehta , "David S . Miller" , Jakub Kicinski , Huazhong Tan , Jian Shen , netdev@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH][next] net: hns3: fix expression that is currently always true Date: Tue, 15 Dec 2020 00:00:33 +0000 Message-Id: <20201215000033.85383-1-colin.king@canonical.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King The || condition in hdev->fd_active_type != HCLGE_FD_ARFS_ACTIVE || hdev->fd_active_type != HCLGE_FD_RULE_NONE will always be true because hdev->fd_active_type cannot be equal to two different values at the same time. The expression is always true which is not correct. Fix this by replacing || with && to correct the logic in the expression. Addresses-Coverity: ("Constant expression result") Fixes: 0205ec041ec6 ("net: hns3: add support for hw tc offload of tc flower") Signed-off-by: Colin Ian King --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 7a164115c845..e6f37f91c489 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -6485,7 +6485,7 @@ static int hclge_add_fd_entry_by_arfs(struct hnae3_handle *handle, u16 queue_id, * arfs should not work */ spin_lock_bh(&hdev->fd_rule_lock); - if (hdev->fd_active_type != HCLGE_FD_ARFS_ACTIVE || + if (hdev->fd_active_type != HCLGE_FD_ARFS_ACTIVE && hdev->fd_active_type != HCLGE_FD_RULE_NONE) { spin_unlock_bh(&hdev->fd_rule_lock); return -EOPNOTSUPP; -- 2.29.2