Commit 631e871e authored by zhong jiang's avatar zhong jiang Committed by David S. Miller

net: qed: list usage cleanup

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: default avatarzhong jiang <zhongjiang@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 30b0594a
...@@ -935,9 +935,8 @@ qed_iwarp_return_ep(struct qed_hwfn *p_hwfn, struct qed_iwarp_ep *ep) ...@@ -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); spin_lock_bh(&p_hwfn->p_rdma_info->iwarp.iw_lock);
list_del(&ep->list_entry); list_move_tail(&ep->list_entry,
list_add_tail(&ep->list_entry, &p_hwfn->p_rdma_info->iwarp.ep_free_list);
&p_hwfn->p_rdma_info->iwarp.ep_free_list);
spin_unlock_bh(&p_hwfn->p_rdma_info->iwarp.iw_lock); 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) ...@@ -2270,8 +2269,8 @@ static void qed_iwarp_process_pending_pkts(struct qed_hwfn *p_hwfn)
if (rc == -EBUSY) if (rc == -EBUSY)
break; break;
list_del(&mpa_buf->list_entry); list_move_tail(&mpa_buf->list_entry,
list_add_tail(&mpa_buf->list_entry, &iwarp_info->mpa_buf_list); &iwarp_info->mpa_buf_list);
if (rc) { /* different error, don't continue */ if (rc) { /* different error, don't continue */
DP_NOTICE(p_hwfn, "process pkts failed rc=%d\n", rc); DP_NOTICE(p_hwfn, "process pkts failed rc=%d\n", rc);
......
...@@ -211,9 +211,8 @@ void qed_ooo_release_connection_isles(struct qed_hwfn *p_hwfn, ...@@ -211,9 +211,8 @@ void qed_ooo_release_connection_isles(struct qed_hwfn *p_hwfn,
if (!p_buffer) if (!p_buffer)
break; break;
list_del(&p_buffer->list_entry); list_move_tail(&p_buffer->list_entry,
list_add_tail(&p_buffer->list_entry, &p_ooo_info->free_buffers_list);
&p_ooo_info->free_buffers_list);
} }
list_add_tail(&p_isle->list_entry, list_add_tail(&p_isle->list_entry,
&p_ooo_info->free_isles_list); &p_ooo_info->free_isles_list);
...@@ -247,9 +246,8 @@ void qed_ooo_release_all_isles(struct qed_hwfn *p_hwfn, ...@@ -247,9 +246,8 @@ void qed_ooo_release_all_isles(struct qed_hwfn *p_hwfn,
if (!p_buffer) if (!p_buffer)
break; break;
list_del(&p_buffer->list_entry); list_move_tail(&p_buffer->list_entry,
list_add_tail(&p_buffer->list_entry, &p_ooo_info->free_buffers_list);
&p_ooo_info->free_buffers_list);
} }
list_add_tail(&p_isle->list_entry, list_add_tail(&p_isle->list_entry,
&p_ooo_info->free_isles_list); &p_ooo_info->free_isles_list);
......
...@@ -730,8 +730,7 @@ static int qed_spq_post_list(struct qed_hwfn *p_hwfn, ...@@ -730,8 +730,7 @@ static int qed_spq_post_list(struct qed_hwfn *p_hwfn,
!list_empty(head)) { !list_empty(head)) {
struct qed_spq_entry *p_ent = struct qed_spq_entry *p_ent =
list_first_entry(head, struct qed_spq_entry, list); list_first_entry(head, struct qed_spq_entry, list);
list_del(&p_ent->list); list_move_tail(&p_ent->list, &p_spq->completion_pending);
list_add_tail(&p_ent->list, &p_spq->completion_pending);
p_spq->comp_sent_count++; p_spq->comp_sent_count++;
rc = qed_spq_hw_post(p_hwfn, p_spq, p_ent); rc = qed_spq_hw_post(p_hwfn, p_spq, p_ent);
......
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