Commit 9d8d5a36 authored by Yufeng Mo's avatar Yufeng Mo Committed by David S. Miller

net: hns3: remove unnecessary variable initialization

If a variable is assigned a value before it is used, it's no
need to assign an initial value to the variable. So remove
these redundant operations.
Signed-off-by: default avatarYufeng Mo <moyufeng@huawei.com>
Signed-off-by: default avatarHuazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 00577c8b
...@@ -19,7 +19,7 @@ static int hns3_dbg_queue_info(struct hnae3_handle *h, ...@@ -19,7 +19,7 @@ static int hns3_dbg_queue_info(struct hnae3_handle *h,
struct hns3_enet_ring *ring; struct hns3_enet_ring *ring;
u32 base_add_l, base_add_h; u32 base_add_l, base_add_h;
u32 queue_num, queue_max; u32 queue_num, queue_max;
u32 value, i = 0; u32 value, i;
int cnt; int cnt;
if (!priv->ring) { if (!priv->ring) {
......
...@@ -1254,7 +1254,7 @@ static bool hns3_skb_need_linearized(struct sk_buff *skb, unsigned int *bd_size, ...@@ -1254,7 +1254,7 @@ static bool hns3_skb_need_linearized(struct sk_buff *skb, unsigned int *bd_size,
void hns3_shinfo_pack(struct skb_shared_info *shinfo, __u32 *size) void hns3_shinfo_pack(struct skb_shared_info *shinfo, __u32 *size)
{ {
int i = 0; int i;
for (i = 0; i < MAX_SKB_FRAGS; i++) for (i = 0; i < MAX_SKB_FRAGS; i++)
size[i] = skb_frag_size(&shinfo->frags[i]); size[i] = skb_frag_size(&shinfo->frags[i]);
...@@ -3511,7 +3511,7 @@ static int hns3_nic_init_vector_data(struct hns3_nic_priv *priv) ...@@ -3511,7 +3511,7 @@ static int hns3_nic_init_vector_data(struct hns3_nic_priv *priv)
struct hnae3_ring_chain_node vector_ring_chain; struct hnae3_ring_chain_node vector_ring_chain;
struct hnae3_handle *h = priv->ae_handle; struct hnae3_handle *h = priv->ae_handle;
struct hns3_enet_tqp_vector *tqp_vector; struct hns3_enet_tqp_vector *tqp_vector;
int ret = 0; int ret;
int i; int i;
hns3_nic_set_cpumask(priv); hns3_nic_set_cpumask(priv);
......
...@@ -261,7 +261,7 @@ int hclge_cmd_send(struct hclge_hw *hw, struct hclge_desc *desc, int num) ...@@ -261,7 +261,7 @@ int hclge_cmd_send(struct hclge_hw *hw, struct hclge_desc *desc, int num)
bool complete = false; bool complete = false;
u32 timeout = 0; u32 timeout = 0;
int handle = 0; int handle = 0;
int retval = 0; int retval;
int ntc; int ntc;
spin_lock_bh(&hw->cmq.csq.lock); spin_lock_bh(&hw->cmq.csq.lock);
......
...@@ -622,7 +622,7 @@ static u8 *hclge_tqps_get_strings(struct hnae3_handle *handle, u8 *data) ...@@ -622,7 +622,7 @@ static u8 *hclge_tqps_get_strings(struct hnae3_handle *handle, u8 *data)
{ {
struct hnae3_knic_private_info *kinfo = &handle->kinfo; struct hnae3_knic_private_info *kinfo = &handle->kinfo;
u8 *buff = data; u8 *buff = data;
int i = 0; int i;
for (i = 0; i < kinfo->num_tqps; i++) { for (i = 0; i < kinfo->num_tqps; i++) {
struct hclge_tqp *tqp = container_of(handle->kinfo.tqp[i], struct hclge_tqp *tqp = container_of(handle->kinfo.tqp[i],
...@@ -3211,7 +3211,7 @@ static int hclge_notify_roce_client(struct hclge_dev *hdev, ...@@ -3211,7 +3211,7 @@ static int hclge_notify_roce_client(struct hclge_dev *hdev,
enum hnae3_reset_notify_type type) enum hnae3_reset_notify_type type)
{ {
struct hnae3_client *client = hdev->roce_client; struct hnae3_client *client = hdev->roce_client;
int ret = 0; int ret;
u16 i; u16 i;
if (!test_bit(HCLGE_STATE_ROCE_REGISTERED, &hdev->state) || !client) if (!test_bit(HCLGE_STATE_ROCE_REGISTERED, &hdev->state) || !client)
...@@ -11093,7 +11093,7 @@ static void hclge_sync_promisc_mode(struct hclge_dev *hdev) ...@@ -11093,7 +11093,7 @@ static void hclge_sync_promisc_mode(struct hclge_dev *hdev)
{ {
struct hclge_vport *vport = &hdev->vport[0]; struct hclge_vport *vport = &hdev->vport[0];
struct hnae3_handle *handle = &vport->nic; struct hnae3_handle *handle = &vport->nic;
u8 tmp_flags = 0; u8 tmp_flags;
int ret; int ret;
if (vport->last_promisc_flags != vport->overflow_promisc_flags) { if (vport->last_promisc_flags != vport->overflow_promisc_flags) {
......
...@@ -1355,7 +1355,7 @@ static int hclge_mac_pause_setup_hw(struct hclge_dev *hdev) ...@@ -1355,7 +1355,7 @@ static int hclge_mac_pause_setup_hw(struct hclge_dev *hdev)
static int hclge_tm_bp_setup(struct hclge_dev *hdev) static int hclge_tm_bp_setup(struct hclge_dev *hdev)
{ {
int ret = 0; int ret;
int i; int i;
for (i = 0; i < hdev->tm_info.num_tc; i++) { for (i = 0; i < hdev->tm_info.num_tc; i++) {
......
...@@ -171,7 +171,7 @@ static u8 *hclgevf_tqps_get_strings(struct hnae3_handle *handle, u8 *data) ...@@ -171,7 +171,7 @@ static u8 *hclgevf_tqps_get_strings(struct hnae3_handle *handle, u8 *data)
{ {
struct hnae3_knic_private_info *kinfo = &handle->kinfo; struct hnae3_knic_private_info *kinfo = &handle->kinfo;
u8 *buff = data; u8 *buff = data;
int i = 0; int i;
for (i = 0; i < kinfo->num_tqps; i++) { for (i = 0; i < kinfo->num_tqps; i++) {
struct hclgevf_tqp *tqp = container_of(kinfo->tqp[i], struct hclgevf_tqp *tqp = container_of(kinfo->tqp[i],
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment