Skip to content

Commit

Permalink
net: qed: list usage cleanup
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
zhong jiang authored and David S. Miller committed Sep 26, 2018
1 parent 30b0594 commit 631e871
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
9 changes: 4 additions & 5 deletions drivers/net/ethernet/qlogic/qed/qed_iwarp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
Expand Down
10 changes: 4 additions & 6 deletions drivers/net/ethernet/qlogic/qed/qed_ooo.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
3 changes: 1 addition & 2 deletions drivers/net/ethernet/qlogic/qed/qed_spq.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 631e871

Please sign in to comment.