diff options
author | Colin Ian King <colin.king@canonical.com> | 2020-12-15 00:00:33 +0000 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2020-12-14 19:42:49 -0800 |
commit | efd5a1584537698220578227e6467638307c2a0b (patch) | |
tree | 086703b7b189d2f29f994d816b7e021ca6151597 /drivers/net | |
parent | a268e0f2455c32653140775662b40c2b1f1b2efa (diff) | |
download | linux-efd5a1584537698220578227e6467638307c2a0b.tar.gz linux-efd5a1584537698220578227e6467638307c2a0b.tar.bz2 linux-efd5a1584537698220578227e6467638307c2a0b.zip |
net: hns3: fix expression that is currently always true
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 <colin.king@canonical.com>
Reviewed-by: Huazhong Tan <tanhuazhong@huawei.com>
Link: https://lore.kernel.org/r/20201215000033.85383-1-colin.king@canonical.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; |