提交 c0162fc3 编写于 作者: B Bohong Lin 提交者: Yang Yingliang

net: hns3: cae clear warnings

driver inclusion
category: bugfix
bugzilla: NA
CVE: NA

------------------------------------------------------------------

This patch is used to clear warnings for hns3 cae.
Signed-off-by: NBohong Lin <linbohong@huawei.com>
Reviewed-by: NWeiwei Deng <dengweiwei@huawei.com>
Reviewed-by:Junxin Chen <chenjunxin1@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 b0ebb657
...@@ -330,7 +330,7 @@ int hns3_cae_dcb_ets_cfg(const struct hns3_nic_priv *net_priv, ...@@ -330,7 +330,7 @@ int hns3_cae_dcb_ets_cfg(const struct hns3_nic_priv *net_priv,
struct hclge_desc desc; struct hclge_desc desc;
int curr_dev_idx; int curr_dev_idx;
int ret; int ret;
int i; u32 i;
if (check) { if (check) {
pr_err("input parameter error in %s function\n", __func__); pr_err("input parameter error in %s function\n", __func__);
......
...@@ -96,7 +96,7 @@ int hns3_cae_get_dfx_info(const struct hns3_nic_priv *net_priv, ...@@ -96,7 +96,7 @@ int hns3_cae_get_dfx_info(const struct hns3_nic_priv *net_priv,
u32 mac_id; u32 mac_id;
bool check = !buf_out || out_size < sizeof(struct hns3_cae_dfx_param); bool check = !buf_out || out_size < sizeof(struct hns3_cae_dfx_param);
int ret; int ret;
int i; u32 i;
if (check) { if (check) {
pr_err("input param buf_out error in %s function\n", __func__); pr_err("input param buf_out error in %s function\n", __func__);
......
...@@ -147,7 +147,7 @@ static int copy_buf_out_to_user(struct msg_module *nt_msg, u32 out_size, ...@@ -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) 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) if (netdev->ethtool_ops->get_drvinfo)
netdev->ethtool_ops->get_drvinfo(netdev, &drv_info); netdev->ethtool_ops->get_drvinfo(netdev, &drv_info);
......
...@@ -433,12 +433,12 @@ int hns3_cae_qcn_cfg(const struct hns3_nic_priv *net_priv, ...@@ -433,12 +433,12 @@ int hns3_cae_qcn_cfg(const struct hns3_nic_priv *net_priv,
u32 out_size) u32 out_size)
{ {
#define HCLGE_OPC_QCN_CFG 0x1A01 #define HCLGE_OPC_QCN_CFG 0x1A01
bool check = !buf_in || in_size < sizeof(32);
struct hclge_vport *vport = NULL; struct hclge_vport *vport = NULL;
struct hclge_dev *hdev = NULL; struct hclge_dev *hdev = NULL;
struct hclge_desc desc; struct hclge_desc desc;
int qcn_bypass; u32 qcn_bypass;
u32 qcn_cfg; u32 qcn_cfg;
bool check = !buf_in || in_size < sizeof(int);
int ret; int ret;
if (check) { if (check) {
...@@ -446,7 +446,7 @@ int hns3_cae_qcn_cfg(const struct hns3_nic_priv *net_priv, ...@@ -446,7 +446,7 @@ int hns3_cae_qcn_cfg(const struct hns3_nic_priv *net_priv,
return -EFAULT; return -EFAULT;
} }
qcn_bypass = *(int *)(buf_in); qcn_bypass = *(u32 *)(buf_in);
vport = hns3_cae_get_vport(net_priv->ae_handle); vport = hns3_cae_get_vport(net_priv->ae_handle);
hdev = vport->back; hdev = vport->back;
......
...@@ -509,9 +509,9 @@ static int hns3_cae_qs_set_new_map(int tc, u32 map, ...@@ -509,9 +509,9 @@ static int hns3_cae_qs_set_new_map(int tc, u32 map,
struct hns3_cae_qs_cfg_info *in_info) struct hns3_cae_qs_cfg_info *in_info)
{ {
u32 bp_map = map; u32 bp_map = map;
u16 offset;
u16 qs_id; u16 qs_id;
int gp_id; int gp_id;
int offset;
qs_id = in_info->qs_id; qs_id = in_info->qs_id;
gp_id = qs_id / 32; gp_id = qs_id / 32;
...@@ -557,7 +557,7 @@ int hns3_cae_qs_cfg(const struct hns3_nic_priv *net_priv, ...@@ -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_vport *vport = hns3_cae_get_vport(net_priv->ae_handle);
struct hclge_dev *hdev = vport->back; struct hclge_dev *hdev = vport->back;
int is_read; int is_read;
int offset; u16 offset;
u32 bp_map; u32 bp_map;
u16 qs_id; u16 qs_id;
int gp_id; int gp_id;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册