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: zhong jiang <zhongjiang@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
zhong jiang 2018-09-26 16:53:00 +08:00 committed by David S. Miller
parent 30b0594a3e
commit 631e871edc
3 changed files with 9 additions and 13 deletions

View File

@ -935,8 +935,7 @@ 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)
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);

View File

@ -211,8 +211,7 @@ 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,
@ -247,8 +246,7 @@ 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,

View File

@ -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);