LVS
lvs-devel
Google
 
Web LinuxVirtualServer.org

[PATCH] ipvs: use list_del_init instead of list_del/INIT_LIST_HEAD

To: wensong@xxxxxxxxxxxx, horms@xxxxxxxxxxxx, ja@xxxxxx, pablo@xxxxxxxxxxxxx, kaber@xxxxxxxxx
Subject: [PATCH] ipvs: use list_del_init instead of list_del/INIT_LIST_HEAD
Cc: yongjun_wei@xxxxxxxxxxxxxxxxx, lvs-devel@xxxxxxxxxxxxxxx, netfilter-devel@xxxxxxxxxxxxxxx, netfilter@xxxxxxxxxxxxxxx
From: Wei Yongjun <weiyj.lk@xxxxxxxxx>
Date: Thu, 6 Sep 2012 12:21:53 +0800
From: Wei Yongjun <yongjun_wei@xxxxxxxxxxxxxxxxx>

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


--
To unsubscribe from this list: send the line "unsubscribe lvs-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

<Prev in Thread] Current Thread [Next in Thread>