summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/hisilicon
diff options
context:
space:
mode:
authorJian Shen <shenjian15@huawei.com>2019-04-15 16:48:38 +0300
committerDavid S. Miller <davem@davemloft.net>2019-04-15 23:39:19 +0300
commit8a9a654b5b5233e7459abcc5f65c53df14b33f67 (patch)
tree1e6a94ee0c9969e4d893487ac17717467cca7652 /drivers/net/ethernet/hisilicon
parentc7cf89b5dd38a9f2aa410f70f80ba0c4c4d02239 (diff)
downloadlinux-8a9a654b5b5233e7459abcc5f65c53df14b33f67.tar.xz
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 <lkp@intel.com> Fixes: 21e043cd8124 ("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>
Diffstat (limited to 'drivers/net/ethernet/hisilicon')
-rw-r--r--drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index d2fb548e1f50..7dba3b448b8b 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -6964,7 +6964,8 @@ 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);
@@ -6972,7 +6973,8 @@ int hclge_update_port_base_vlan_cfg(struct hclge_vport *vport, u16 state,
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);