]> git.baikalelectronics.ru Git - kernel.git/commit
net: hns3: fix expression that is currently always true
authorColin Ian King <colin.king@canonical.com>
Tue, 15 Dec 2020 00:00:33 +0000 (00:00 +0000)
committerJakub Kicinski <kuba@kernel.org>
Tue, 15 Dec 2020 03:42:49 +0000 (19:42 -0800)
commita0c7e172cf1ab6acf714a22c1c9b355f39cf27db
tree086703b7b189d2f29f994d816b7e021ca6151597
parent776939c3210121a2e14b8d7f0f0ae5b02f580eb8
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: 0af5e4f4bafc ("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>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c