Commit 54a27924 authored by Wei Yongjun's avatar Wei Yongjun Committed by David S. Miller

sctp: use list_move_tail instead of list_del/list_add_tail

Using list_move_tail() instead of list_del() + list_add_tail().

spatch with a semantic match is used to found this problem.
(http://coccinelle.lip6.fr/)
Signed-off-by: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6e129d04
...@@ -591,8 +591,7 @@ static int sctp_outq_flush_rtx(struct sctp_outq *q, struct sctp_packet *pkt, ...@@ -591,8 +591,7 @@ static int sctp_outq_flush_rtx(struct sctp_outq *q, struct sctp_packet *pkt,
* next chunk. * next chunk.
*/ */
if (chunk->tsn_gap_acked) { if (chunk->tsn_gap_acked) {
list_del(&chunk->transmitted_list); list_move_tail(&chunk->transmitted_list,
list_add_tail(&chunk->transmitted_list,
&transport->transmitted); &transport->transmitted);
continue; continue;
} }
...@@ -657,8 +656,7 @@ static int sctp_outq_flush_rtx(struct sctp_outq *q, struct sctp_packet *pkt, ...@@ -657,8 +656,7 @@ static int sctp_outq_flush_rtx(struct sctp_outq *q, struct sctp_packet *pkt,
/* The append was successful, so add this chunk to /* The append was successful, so add this chunk to
* the transmitted list. * the transmitted list.
*/ */
list_del(&chunk->transmitted_list); list_move_tail(&chunk->transmitted_list,
list_add_tail(&chunk->transmitted_list,
&transport->transmitted); &transport->transmitted);
/* Mark the chunk as ineligible for fast retransmit /* Mark the chunk as ineligible for fast retransmit
......
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