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: Yufeng Mo <moyufeng@huawei.com> Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
00577c8b7f
commit
9d8d5a360b
|
@ -19,7 +19,7 @@ static int hns3_dbg_queue_info(struct hnae3_handle *h,
|
|||
struct hns3_enet_ring *ring;
|
||||
u32 base_add_l, base_add_h;
|
||||
u32 queue_num, queue_max;
|
||||
u32 value, i = 0;
|
||||
u32 value, i;
|
||||
int cnt;
|
||||
|
||||
if (!priv->ring) {
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
int i = 0;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < MAX_SKB_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)
|
|||
struct hnae3_ring_chain_node vector_ring_chain;
|
||||
struct hnae3_handle *h = priv->ae_handle;
|
||||
struct hns3_enet_tqp_vector *tqp_vector;
|
||||
int ret = 0;
|
||||
int ret;
|
||||
int i;
|
||||
|
||||
hns3_nic_set_cpumask(priv);
|
||||
|
|
|
@ -261,7 +261,7 @@ int hclge_cmd_send(struct hclge_hw *hw, struct hclge_desc *desc, int num)
|
|||
bool complete = false;
|
||||
u32 timeout = 0;
|
||||
int handle = 0;
|
||||
int retval = 0;
|
||||
int retval;
|
||||
int ntc;
|
||||
|
||||
spin_lock_bh(&hw->cmq.csq.lock);
|
||||
|
|
|
@ -622,7 +622,7 @@ static u8 *hclge_tqps_get_strings(struct hnae3_handle *handle, u8 *data)
|
|||
{
|
||||
struct hnae3_knic_private_info *kinfo = &handle->kinfo;
|
||||
u8 *buff = data;
|
||||
int i = 0;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < kinfo->num_tqps; 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,
|
|||
enum hnae3_reset_notify_type type)
|
||||
{
|
||||
struct hnae3_client *client = hdev->roce_client;
|
||||
int ret = 0;
|
||||
int ret;
|
||||
u16 i;
|
||||
|
||||
if (!test_bit(HCLGE_STATE_ROCE_REGISTERED, &hdev->state) || !client)
|
||||
|
@ -11093,7 +11093,7 @@ static void hclge_sync_promisc_mode(struct hclge_dev *hdev)
|
|||
{
|
||||
struct hclge_vport *vport = &hdev->vport[0];
|
||||
struct hnae3_handle *handle = &vport->nic;
|
||||
u8 tmp_flags = 0;
|
||||
u8 tmp_flags;
|
||||
int ret;
|
||||
|
||||
if (vport->last_promisc_flags != vport->overflow_promisc_flags) {
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
int ret = 0;
|
||||
int ret;
|
||||
int 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)
|
|||
{
|
||||
struct hnae3_knic_private_info *kinfo = &handle->kinfo;
|
||||
u8 *buff = data;
|
||||
int i = 0;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < kinfo->num_tqps; i++) {
|
||||
struct hclgevf_tqp *tqp = container_of(kinfo->tqp[i],
|
||||
|
|
Loading…
Reference in New Issue