Commit 8a9a654b authored by Jian Shen's avatar Jian Shen Committed by David S. Miller

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: default avatarkbuild test robot <lkp@intel.com>
Fixes: 21e043cd ("net: hns3: fix set port based VLAN for PF")
Signed-off-by: default avatarJian Shen <shenjian15@huawei.com>
Signed-off-by: default avatarHuazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c7cf89b5
...@@ -6964,7 +6964,8 @@ int hclge_update_port_base_vlan_cfg(struct hclge_vport *vport, u16 state, ...@@ -6964,7 +6964,8 @@ int hclge_update_port_base_vlan_cfg(struct hclge_vport *vport, u16 state,
if (state == HNAE3_PORT_BASE_VLAN_MODIFY) { if (state == HNAE3_PORT_BASE_VLAN_MODIFY) {
/* add new VLAN tag */ /* add new VLAN tag */
ret = hclge_set_vlan_filter_hw(hdev, vlan_info->vlan_proto, ret = hclge_set_vlan_filter_hw(hdev,
htons(vlan_info->vlan_proto),
vport->vport_id, vport->vport_id,
vlan_info->vlan_tag, vlan_info->vlan_tag,
vlan_info->qos, false); vlan_info->qos, false);
...@@ -6972,7 +6973,8 @@ int hclge_update_port_base_vlan_cfg(struct hclge_vport *vport, u16 state, ...@@ -6972,7 +6973,8 @@ int hclge_update_port_base_vlan_cfg(struct hclge_vport *vport, u16 state,
return ret; return ret;
/* remove old VLAN tag */ /* remove old VLAN tag */
ret = hclge_set_vlan_filter_hw(hdev, old_vlan_info->vlan_proto, ret = hclge_set_vlan_filter_hw(hdev,
htons(old_vlan_info->vlan_proto),
vport->vport_id, vport->vport_id,
old_vlan_info->vlan_tag, old_vlan_info->vlan_tag,
old_vlan_info->qos, true); old_vlan_info->qos, true);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment