All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sctp: use list_move_tail instead of list_del/list_add_tail
@ 2012-09-04  9:58 ` Wei Yongjun
  0 siblings, 0 replies; 4+ messages in thread
From: Wei Yongjun @ 2012-09-04  9:58 UTC (permalink / raw)
  To: vyasevich, sri, davem; +Cc: yongjun_wei, linux-sctp, netdev

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

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: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 net/sctp/outqueue.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c
index e7aa177c..d10cbf1 100644
--- a/net/sctp/outqueue.c
+++ b/net/sctp/outqueue.c
@@ -589,9 +589,8 @@ static int sctp_outq_flush_rtx(struct sctp_outq *q, struct sctp_packet *pkt,
 		 * next chunk.
 		 */
 		if (chunk->tsn_gap_acked) {
-			list_del(&chunk->transmitted_list);
-			list_add_tail(&chunk->transmitted_list,
-					&transport->transmitted);
+			list_move_tail(&chunk->transmitted_list,
+				       &transport->transmitted);
 			continue;
 		}
 
@@ -655,9 +654,8 @@ redo:
 			/* The append was successful, so add this chunk to
 			 * the transmitted list.
 			 */
-			list_del(&chunk->transmitted_list);
-			list_add_tail(&chunk->transmitted_list,
-					&transport->transmitted);
+			list_move_tail(&chunk->transmitted_list,
+				       &transport->transmitted);
 
 			/* Mark the chunk as ineligible for fast retransmit
 			 * after it is retransmitted.

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] sctp: use list_move_tail instead of list_del/list_add_tail
@ 2012-09-04  9:58 ` Wei Yongjun
  0 siblings, 0 replies; 4+ messages in thread
From: Wei Yongjun @ 2012-09-04  9:58 UTC (permalink / raw)
  To: vyasevich, sri, davem; +Cc: yongjun_wei, linux-sctp, netdev

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

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: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 net/sctp/outqueue.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c
index e7aa177c..d10cbf1 100644
--- a/net/sctp/outqueue.c
+++ b/net/sctp/outqueue.c
@@ -589,9 +589,8 @@ static int sctp_outq_flush_rtx(struct sctp_outq *q, struct sctp_packet *pkt,
 		 * next chunk.
 		 */
 		if (chunk->tsn_gap_acked) {
-			list_del(&chunk->transmitted_list);
-			list_add_tail(&chunk->transmitted_list,
-					&transport->transmitted);
+			list_move_tail(&chunk->transmitted_list,
+				       &transport->transmitted);
 			continue;
 		}
 
@@ -655,9 +654,8 @@ redo:
 			/* The append was successful, so add this chunk to
 			 * the transmitted list.
 			 */
-			list_del(&chunk->transmitted_list);
-			list_add_tail(&chunk->transmitted_list,
-					&transport->transmitted);
+			list_move_tail(&chunk->transmitted_list,
+				       &transport->transmitted);
 
 			/* Mark the chunk as ineligible for fast retransmit
 			 * after it is retransmitted.



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] sctp: use list_move_tail instead of list_del/list_add_tail
  2012-09-04  9:58 ` Wei Yongjun
@ 2012-09-04 18:16   ` David Miller
  -1 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2012-09-04 18:16 UTC (permalink / raw)
  To: weiyj.lk; +Cc: vyasevich, sri, yongjun_wei, linux-sctp, netdev

From: Wei Yongjun <weiyj.lk@gmail.com>
Date: Tue, 4 Sep 2012 17:58:16 +0800

> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> 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: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Applied to net-next, thank you.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] sctp: use list_move_tail instead of list_del/list_add_tail
@ 2012-09-04 18:16   ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2012-09-04 18:16 UTC (permalink / raw)
  To: weiyj.lk; +Cc: vyasevich, sri, yongjun_wei, linux-sctp, netdev

From: Wei Yongjun <weiyj.lk@gmail.com>
Date: Tue, 4 Sep 2012 17:58:16 +0800

> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> 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: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Applied to net-next, thank you.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-09-04 18:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-04  9:58 [PATCH] sctp: use list_move_tail instead of list_del/list_add_tail Wei Yongjun
2012-09-04  9:58 ` Wei Yongjun
2012-09-04 18:16 ` David Miller
2012-09-04 18:16   ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.