From: Bohong Lin linbohong@huawei.com
driver inclusion category: bugfix bugzilla: NA CVE: NA
------------------------------------------------------------------
This patch is used to clear warnings for hns3 cae.
Signed-off-by: Bohong Lin linbohong@huawei.com Reviewed-by: Weiwei Deng dengweiwei@huawei.com Reviewed-by:Junxin Chen chenjunxin1@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- drivers/net/ethernet/hisilicon/hns3/hns3_cae/hns3_cae_dcb.c | 2 +- drivers/net/ethernet/hisilicon/hns3/hns3_cae/hns3_cae_dfx.c | 2 +- drivers/net/ethernet/hisilicon/hns3/hns3_cae/hns3_cae_init.c | 2 +- drivers/net/ethernet/hisilicon/hns3/hns3_cae/hns3_cae_qos.c | 6 +++--- drivers/net/ethernet/hisilicon/hns3/hns3_cae/hns3_cae_tm.c | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_cae/hns3_cae_dcb.c b/drivers/net/ethernet/hisilicon/hns3/hns3_cae/hns3_cae_dcb.c index fa6c6b4..8d037f4 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_cae/hns3_cae_dcb.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_cae/hns3_cae_dcb.c @@ -330,7 +330,7 @@ int hns3_cae_dcb_ets_cfg(const struct hns3_nic_priv *net_priv, struct hclge_desc desc; int curr_dev_idx; int ret; - int i; + u32 i;
if (check) { pr_err("input parameter error in %s function\n", __func__); diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_cae/hns3_cae_dfx.c b/drivers/net/ethernet/hisilicon/hns3/hns3_cae/hns3_cae_dfx.c index 6346c9a..253972b 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_cae/hns3_cae_dfx.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_cae/hns3_cae_dfx.c @@ -96,7 +96,7 @@ int hns3_cae_get_dfx_info(const struct hns3_nic_priv *net_priv, u32 mac_id; bool check = !buf_out || out_size < sizeof(struct hns3_cae_dfx_param); int ret; - int i; + u32 i;
if (check) { pr_err("input param buf_out error in %s function\n", __func__); diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_cae/hns3_cae_init.c b/drivers/net/ethernet/hisilicon/hns3/hns3_cae/hns3_cae_init.c index 96f0bb0..ad84900 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_cae/hns3_cae_init.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_cae/hns3_cae_init.c @@ -147,7 +147,7 @@ static int copy_buf_out_to_user(struct msg_module *nt_msg, u32 out_size,
static int hns3_cae_netdev_match_check(struct net_device *netdev) { - struct ethtool_drvinfo drv_info; + struct ethtool_drvinfo drv_info = {0};
if (netdev->ethtool_ops->get_drvinfo) netdev->ethtool_ops->get_drvinfo(netdev, &drv_info); diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_cae/hns3_cae_qos.c b/drivers/net/ethernet/hisilicon/hns3/hns3_cae/hns3_cae_qos.c index ffd9e3f..0a98155 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_cae/hns3_cae_qos.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_cae/hns3_cae_qos.c @@ -433,12 +433,12 @@ int hns3_cae_qcn_cfg(const struct hns3_nic_priv *net_priv, u32 out_size) { #define HCLGE_OPC_QCN_CFG 0x1A01 + bool check = !buf_in || in_size < sizeof(32); struct hclge_vport *vport = NULL; struct hclge_dev *hdev = NULL; struct hclge_desc desc; - int qcn_bypass; + u32 qcn_bypass; u32 qcn_cfg; - bool check = !buf_in || in_size < sizeof(int); int ret;
if (check) { @@ -446,7 +446,7 @@ int hns3_cae_qcn_cfg(const struct hns3_nic_priv *net_priv, return -EFAULT; }
- qcn_bypass = *(int *)(buf_in); + qcn_bypass = *(u32 *)(buf_in); vport = hns3_cae_get_vport(net_priv->ae_handle); hdev = vport->back;
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_cae/hns3_cae_tm.c b/drivers/net/ethernet/hisilicon/hns3/hns3_cae/hns3_cae_tm.c index b3a89e2..1a3efcf 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_cae/hns3_cae_tm.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_cae/hns3_cae_tm.c @@ -509,9 +509,9 @@ static int hns3_cae_qs_set_new_map(int tc, u32 map, struct hns3_cae_qs_cfg_info *in_info) { u32 bp_map = map; + u16 offset; u16 qs_id; int gp_id; - int offset;
qs_id = in_info->qs_id; gp_id = qs_id / 32; @@ -557,7 +557,7 @@ int hns3_cae_qs_cfg(const struct hns3_nic_priv *net_priv, struct hclge_vport *vport = hns3_cae_get_vport(net_priv->ae_handle); struct hclge_dev *hdev = vport->back; int is_read; - int offset; + u16 offset; u32 bp_map; u16 qs_id; int gp_id;