net: qed: list usage cleanup
authorzhong jiang <zhongjiang@huawei.com>
Wed, 26 Sep 2018 08:53:00 +0000 (16:53 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 26 Sep 2018 17:11:36 +0000 (10:11 -0700)
Trival cleanup, list_move_tail will implement the same function that
list_del() + list_add_tail() will do. hence just replace them.

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/qed/qed_iwarp.c
drivers/net/ethernet/qlogic/qed/qed_ooo.c
drivers/net/ethernet/qlogic/qed/qed_spq.c

index 17f3dfa2cc94084552a6f66cae0044c46af35fec..f99797a149a4229a6e6209436e30b818989e7ccf 100644 (file)
@@ -935,9 +935,8 @@ qed_iwarp_return_ep(struct qed_hwfn *p_hwfn, struct qed_iwarp_ep *ep)
        }
        spin_lock_bh(&p_hwfn->p_rdma_info->iwarp.iw_lock);
 
-       list_del(&ep->list_entry);
-       list_add_tail(&ep->list_entry,
-                     &p_hwfn->p_rdma_info->iwarp.ep_free_list);
+       list_move_tail(&ep->list_entry,
+                      &p_hwfn->p_rdma_info->iwarp.ep_free_list);
 
        spin_unlock_bh(&p_hwfn->p_rdma_info->iwarp.iw_lock);
 }
@@ -2270,8 +2269,8 @@ static void qed_iwarp_process_pending_pkts(struct qed_hwfn *p_hwfn)
                if (rc == -EBUSY)
                        break;
 
-               list_del(&mpa_buf->list_entry);
-               list_add_tail(&mpa_buf->list_entry, &iwarp_info->mpa_buf_list);
+               list_move_tail(&mpa_buf->list_entry,
+                              &iwarp_info->mpa_buf_list);
 
                if (rc) {       /* different error, don't continue */
                        DP_NOTICE(p_hwfn, "process pkts failed rc=%d\n", rc);
index 6172354b451c1f72c887d8124fd4915c26084eed..63931dfc77cf2236b868d9125c7d393327ffaad6 100644 (file)
@@ -211,9 +211,8 @@ void qed_ooo_release_connection_isles(struct qed_hwfn *p_hwfn,
                        if (!p_buffer)
                                break;
 
-                       list_del(&p_buffer->list_entry);
-                       list_add_tail(&p_buffer->list_entry,
-                                     &p_ooo_info->free_buffers_list);
+                       list_move_tail(&p_buffer->list_entry,
+                                      &p_ooo_info->free_buffers_list);
                }
                list_add_tail(&p_isle->list_entry,
                              &p_ooo_info->free_isles_list);
@@ -247,9 +246,8 @@ void qed_ooo_release_all_isles(struct qed_hwfn *p_hwfn,
                                if (!p_buffer)
                                        break;
 
-                       list_del(&p_buffer->list_entry);
-                               list_add_tail(&p_buffer->list_entry,
-                                             &p_ooo_info->free_buffers_list);
+                               list_move_tail(&p_buffer->list_entry,
+                                              &p_ooo_info->free_buffers_list);
                        }
                        list_add_tail(&p_isle->list_entry,
                                      &p_ooo_info->free_isles_list);
index 1673fc90027f8e538a1aaf4aee92b0e33b9b09ce..c4a6274dd625c2bf419cc78dfab20f899ada494d 100644 (file)
@@ -730,8 +730,7 @@ static int qed_spq_post_list(struct qed_hwfn *p_hwfn,
               !list_empty(head)) {
                struct qed_spq_entry *p_ent =
                        list_first_entry(head, struct qed_spq_entry, list);
-               list_del(&p_ent->list);
-               list_add_tail(&p_ent->list, &p_spq->completion_pending);
+               list_move_tail(&p_ent->list, &p_spq->completion_pending);
                p_spq->comp_sent_count++;
 
                rc = qed_spq_hw_post(p_hwfn, p_spq, p_ent);