net: hns3: refine function hclge_set_vf_vlan_cfg()
authorJian Shen <shenjian15@huawei.com>
Mon, 31 May 2021 02:38:41 +0000 (10:38 +0800)
committerJakub Kicinski <kuba@kernel.org>
Tue, 1 Jun 2021 05:53:07 +0000 (22:53 -0700)
commit060e9accaa743d701e653213651cf3feee1ae921
tree070a09eb194eb09f1887f790a221c846819a2e59
parent132023de7149e7dde4b457328cb233dc58561b54
net: hns3: refine function hclge_set_vf_vlan_cfg()

The struct hclge_vf_vlan_cfg is firstly designed for setting
VLAN filter tag. And it's reused for enable RX VLAN offload
later. It's strange to use member "is_kill" to indicate "enable".
So redefine the struct hclge_vf_vlan_cfg to adapt it.

For there are already 3 subcodes being used in function
hclge_set_vf_vlan_cfg(), use "switch-case" style for each
branch, rather than "if-else". Also simplify the assignment for
each branch to make it more clearly.

Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c