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

* Re: [PATCH] ipvs: use list_del_init instead of list_del/INIT_LIST_HEAD
  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
  0 siblings, 1 reply; 3+ messages in thread
From: Simon Horman @ 2012-09-10  0:01 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: wensong, ja, pablo, kaber, yongjun_wei, lvs-devel,
	netfilter-devel, netfilter

On Thu, Sep 06, 2012 at 12:21:53PM +0800, Wei Yongjun wrote:
> 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>

Acked-by: Simon Horman <horms@verge.net.au>

> ---
>  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	[flat|nested] 3+ messages in thread

* Re: [PATCH] ipvs: use list_del_init instead of list_del/INIT_LIST_HEAD
  2012-09-10  0:01 ` Simon Horman
@ 2012-09-10  9:16   ` Pablo Neira Ayuso
  0 siblings, 0 replies; 3+ messages in thread
From: Pablo Neira Ayuso @ 2012-09-10  9:16 UTC (permalink / raw)
  To: Simon Horman
  Cc: Wei Yongjun, wensong, ja, kaber, yongjun_wei, lvs-devel,
	netfilter-devel, netfilter

On Mon, Sep 10, 2012 at 09:01:30AM +0900, Simon Horman wrote:
> On Thu, Sep 06, 2012 at 12:21:53PM +0800, Wei Yongjun wrote:
> > 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>
> 
> Acked-by: Simon Horman <horms@verge.net.au>

Applied, thanks Simon and Wei.

^ permalink raw reply	[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).