Skip to content

Commit 8a9a654

Browse files
IronShendavem330
authored andcommitted
net: hns3: fix sparse: warning when calling hclge_set_vlan_filter_hw()
The input parameter "proto" in function hclge_set_vlan_filter_hw() is asked to be __be16, but got u16 when calling it in function hclge_update_port_base_vlan_cfg(). This patch fixes it by converting it with htons(). Reported-by: kbuild test robot <[email protected]> Fixes: 21e043c ("net: hns3: fix set port based VLAN for PF") Signed-off-by: Jian Shen <[email protected]> Signed-off-by: Huazhong Tan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c7cf89b commit 8a9a654

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6964,15 +6964,17 @@ int hclge_update_port_base_vlan_cfg(struct hclge_vport *vport, u16 state,
69646964

69656965
if (state == HNAE3_PORT_BASE_VLAN_MODIFY) {
69666966
/* add new VLAN tag */
6967-
ret = hclge_set_vlan_filter_hw(hdev, vlan_info->vlan_proto,
6967+
ret = hclge_set_vlan_filter_hw(hdev,
6968+
htons(vlan_info->vlan_proto),
69686969
vport->vport_id,
69696970
vlan_info->vlan_tag,
69706971
vlan_info->qos, false);
69716972
if (ret)
69726973
return ret;
69736974

69746975
/* remove old VLAN tag */
6975-
ret = hclge_set_vlan_filter_hw(hdev, old_vlan_info->vlan_proto,
6976+
ret = hclge_set_vlan_filter_hw(hdev,
6977+
htons(old_vlan_info->vlan_proto),
69766978
vport->vport_id,
69776979
old_vlan_info->vlan_tag,
69786980
old_vlan_info->qos, true);

0 commit comments

Comments
 (0)