summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/huawei
diff options
context:
space:
mode:
authorZhengchao Shao <shaozhengchao@huawei.com>2022-09-21 20:33:54 +0800
committerJakub Kicinski <kuba@kernel.org>2022-09-22 17:41:27 -0700
commit4f304250c39b4c6bae40521524cc9235ba8ab327 (patch)
tree9f9e65a0bed1b496b8b40d6c84c5fa857e07fd6e /drivers/net/ethernet/huawei
parent97d6a3e642bfe1671c746d6bed478eabf2c23d73 (diff)
downloadlinux-next-4f304250c39b4c6bae40521524cc9235ba8ab327.tar.gz
net: hinic: simplify code logic
simplify code logic in hinic_ndo_set_vf_trust() and hinic_ndo_set_vf_spoofchk(). Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/huawei')
-rw-r--r--drivers/net/ethernet/huawei/hinic/hinic_sriov.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/huawei/hinic/hinic_sriov.c b/drivers/net/ethernet/huawei/hinic/hinic_sriov.c
index a8f71a69ddcc..00a66e6e3060 100644
--- a/drivers/net/ethernet/huawei/hinic/hinic_sriov.c
+++ b/drivers/net/ethernet/huawei/hinic/hinic_sriov.c
@@ -820,7 +820,7 @@ int hinic_ndo_set_vf_trust(struct net_device *netdev, int vf, bool setting)
cur_trust = nic_io->vf_infos[vf].trust;
/* same request, so just return success */
- if ((setting && cur_trust) || (!setting && !cur_trust))
+ if (setting == cur_trust)
return 0;
err = hinic_set_vf_trust(adapter->hwdev, vf, setting);
@@ -940,7 +940,7 @@ int hinic_ndo_set_vf_spoofchk(struct net_device *netdev, int vf, bool setting)
cur_spoofchk = nic_dev->hwdev->func_to_io.vf_infos[vf].spoofchk;
/* same request, so just return success */
- if ((setting && cur_spoofchk) || (!setting && !cur_spoofchk))
+ if (setting == cur_spoofchk)
return 0;
err = hinic_set_vf_spoofchk(sriov_info->hwdev,