netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ipvs: use list_del_init instead of list_del/INIT_LIST_HEAD
@ 2012-09-06  4:21 Wei Yongjun
  2012-09-10  0:01 ` Simon Horman
  0 siblings, 1 reply; 3+ messages in thread
From: Wei Yongjun @ 2012-09-06  4:21 UTC (permalink / raw)
  To: wensong, horms, ja, pablo, kaber
  Cc: yongjun_wei, lvs-devel, netfilter-devel, netfilter

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

Using list_del_init() instead of list_del() + INIT_LIST_HEAD().

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/netfilter/ipvs/ip_vs_ctl.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
index f51013c..9d9f83e 100644
--- a/net/netfilter/ipvs/ip_vs_ctl.c
+++ b/net/netfilter/ipvs/ip_vs_ctl.c
@@ -539,8 +539,7 @@ static int ip_vs_rs_unhash(struct ip_vs_dest *dest)
 	 * Remove it from the rs_table table.
 	 */
 	if (!list_empty(&dest->d_list)) {
-		list_del(&dest->d_list);
-		INIT_LIST_HEAD(&dest->d_list);
+		list_del_init(&dest->d_list);
 	}
 
 	return 1;



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

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

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-06  4:21 [PATCH] ipvs: use list_del_init instead of list_del/INIT_LIST_HEAD Wei Yongjun
2012-09-10  0:01 ` Simon Horman
2012-09-10  9:16   ` Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).