Skip to content

Commit

Permalink
net: hns3: fix sparse: warning when calling hclge_set_vlan_filter_hw()
Browse files Browse the repository at this point in the history
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 <lkp@intel.com>
Fixes: 21e043c ("net: hns3: fix set port based VLAN for PF")
Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jian Shen authored and David S. Miller committed Apr 15, 2019
1 parent c7cf89b commit 8a9a654
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6964,15 +6964,17 @@ int hclge_update_port_base_vlan_cfg(struct hclge_vport *vport, u16 state,

if (state == HNAE3_PORT_BASE_VLAN_MODIFY) {
/* 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,
vlan_info->vlan_tag,
vlan_info->qos, false);
if (ret)
return ret;

/* 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,
old_vlan_info->vlan_tag,
old_vlan_info->qos, true);
Expand Down

0 comments on commit 8a9a654

Please sign in to comment.