Skip to content

Commit 37417c6

Browse files
Guojia Liaodavem330
authored andcommitted
net: hns3: fix error and incorrect format
The pointer type parameter should be declare as const for preventing from its pointed value being unexpected modified. The uninitialized variable can not be return directly. The default return value is 0 if no abnormal result. This patch fixes the preceding two errors, deletes redundant declaration of a function and align one parameter. Signed-off-by: Guojia Liao <[email protected]> Signed-off-by: Weihang Li <[email protected]> Signed-off-by: Jian Shen <[email protected]> Signed-off-by: Guangbin Huang <[email protected]> Signed-off-by: Huazhong Tan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent cdd332a commit 37417c6

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

drivers/net/ethernet/hisilicon/hns3/hnae3.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ void hnae3_set_client_init_flag(struct hnae3_client *client,
4646
EXPORT_SYMBOL(hnae3_set_client_init_flag);
4747

4848
static int hnae3_get_client_init_flag(struct hnae3_client *client,
49-
struct hnae3_ae_dev *ae_dev)
49+
struct hnae3_ae_dev *ae_dev)
5050
{
5151
int inited = 0;
5252

drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@ static int hns3_get_link_ksettings(struct net_device *netdev,
704704
return 0;
705705
}
706706

707-
static int hns3_check_ksettings_param(struct net_device *netdev,
707+
static int hns3_check_ksettings_param(const struct net_device *netdev,
708708
const struct ethtool_link_ksettings *cmd)
709709
{
710710
struct hnae3_handle *handle = hns3_get_handle(netdev);

drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,6 +1128,7 @@ static void hclge_parse_link_mode(struct hclge_dev *hdev, u8 speed_ability)
11281128
else if (media_type == HNAE3_MEDIA_TYPE_BACKPLANE)
11291129
hclge_parse_backplane_link_mode(hdev, speed_ability);
11301130
}
1131+
11311132
static void hclge_parse_cfg(struct hclge_cfg *cfg, struct hclge_desc *desc)
11321133
{
11331134
struct hclge_cfg_param_cmd *req;
@@ -4364,8 +4365,8 @@ int hclge_bind_ring_with_vector(struct hclge_vport *vport,
43644365
struct hclge_dev *hdev = vport->back;
43654366
struct hnae3_ring_chain_node *node;
43664367
struct hclge_desc desc;
4367-
struct hclge_ctrl_vector_chain_cmd *req
4368-
= (struct hclge_ctrl_vector_chain_cmd *)desc.data;
4368+
struct hclge_ctrl_vector_chain_cmd *req =
4369+
(struct hclge_ctrl_vector_chain_cmd *)desc.data;
43694370
enum hclge_cmd_status status;
43704371
enum hclge_opcode_type op;
43714372
u16 tqp_type_and_id;
@@ -8656,7 +8657,7 @@ static int hclge_init_client_instance(struct hnae3_client *client,
86568657
}
86578658
}
86588659

8659-
return ret;
8660+
return 0;
86608661

86618662
clear_nic:
86628663
hdev->nic_client = NULL;

drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1000,7 +1000,6 @@ int hclge_buffer_alloc(struct hclge_dev *hdev);
10001000
int hclge_rss_init_hw(struct hclge_dev *hdev);
10011001
void hclge_rss_indir_init_cfg(struct hclge_dev *hdev);
10021002

1003-
int hclge_inform_reset_assert_to_vf(struct hclge_vport *vport);
10041003
void hclge_mbx_handler(struct hclge_dev *hdev);
10051004
int hclge_reset_tqp(struct hnae3_handle *handle, u16 queue_id);
10061005
void hclge_reset_vf_queue(struct hclge_vport *vport, u16 queue_id);

0 commit comments

Comments
 (0)