Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1475900 > unrolled thread

[PATCH] sctp: Remove some redundant code

Started byChristophe JAILLET <christophe.jaillet@wanadoo.fr>
First post2016-09-04 11:50 +0200
Last post2016-09-07 17:30 +0200
Articles 4 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] sctp: Remove some redundant code Christophe JAILLET <christophe.jaillet@wanadoo.fr> - 2016-09-04 11:50 +0200
    Re: [PATCH] sctp: Remove some redundant code marcelo.leitner@gmail.com - 2016-09-05 14:50 +0200
    Re: [PATCH] sctp: Remove some redundant code marcelo.leitner@gmail.com - 2016-09-06 01:50 +0200
    Re: [PATCH] sctp: Remove some redundant code Neil Horman <nhorman@tuxdriver.com> - 2016-09-07 17:30 +0200

#1475900 — [PATCH] sctp: Remove some redundant code

FromChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Date2016-09-04 11:50 +0200
Subject[PATCH] sctp: Remove some redundant code
Message-ID<sdCdP-3hB-3@gated-at.bofh.it>
In commit 311b21774f13 ("sctp: simplify sk_receive_queue locking"), a call
to 'skb_queue_splice_tail_init()' has been made explicit. Previously it was
hidden in 'sctp_skb_list_tail()'

Now, the code around it looks redundant. The '_init()' part of
'skb_queue_splice_tail_init()' should alreday do the same.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
Un-tested
---
 net/sctp/ulpqueue.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/net/sctp/ulpqueue.c b/net/sctp/ulpqueue.c
index 877e55066f89..84d0fdaf7de9 100644
--- a/net/sctp/ulpqueue.c
+++ b/net/sctp/ulpqueue.c
@@ -140,11 +140,8 @@ int sctp_clear_pd(struct sock *sk, struct sctp_association *asoc)
 		 * we can go ahead and clear out the lobby in one shot
 		 */
 		if (!skb_queue_empty(&sp->pd_lobby)) {
-			struct list_head *list;
 			skb_queue_splice_tail_init(&sp->pd_lobby,
 						   &sk->sk_receive_queue);
-			list = (struct list_head *)&sctp_sk(sk)->pd_lobby;
-			INIT_LIST_HEAD(list);
 			return 1;
 		}
 	} else {
-- 
2.7.4

[toc] | [next] | [standalone]


#1476389

Frommarcelo.leitner@gmail.com
Date2016-09-05 14:50 +0200
Message-ID<se1vA-3Ov-33@gated-at.bofh.it>
In reply to#1475900
On Sun, Sep 04, 2016 at 11:38:13AM +0200, Christophe JAILLET wrote:
> In commit 311b21774f13 ("sctp: simplify sk_receive_queue locking"), a call
> to 'skb_queue_splice_tail_init()' has been made explicit. Previously it was
> hidden in 'sctp_skb_list_tail()'
> 
> Now, the code around it looks redundant. The '_init()' part of
> 'skb_queue_splice_tail_init()' should alreday do the same.

Nice

> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> Un-tested

Okay. It seems good to me but I'll give this a run after lunch anyway.
Thanks

> ---
>  net/sctp/ulpqueue.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/net/sctp/ulpqueue.c b/net/sctp/ulpqueue.c
> index 877e55066f89..84d0fdaf7de9 100644
> --- a/net/sctp/ulpqueue.c
> +++ b/net/sctp/ulpqueue.c
> @@ -140,11 +140,8 @@ int sctp_clear_pd(struct sock *sk, struct sctp_association *asoc)
>  		 * we can go ahead and clear out the lobby in one shot
>  		 */
>  		if (!skb_queue_empty(&sp->pd_lobby)) {
> -			struct list_head *list;
>  			skb_queue_splice_tail_init(&sp->pd_lobby,
>  						   &sk->sk_receive_queue);
> -			list = (struct list_head *)&sctp_sk(sk)->pd_lobby;
> -			INIT_LIST_HEAD(list);
>  			return 1;
>  		}
>  	} else {
> -- 
> 2.7.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sctp" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

[toc] | [prev] | [next] | [standalone]


#1477001

Frommarcelo.leitner@gmail.com
Date2016-09-06 01:50 +0200
Message-ID<sebOh-2i9-3@gated-at.bofh.it>
In reply to#1475900
On Sun, Sep 04, 2016 at 11:38:13AM +0200, Christophe JAILLET wrote:
> In commit 311b21774f13 ("sctp: simplify sk_receive_queue locking"), a call
> to 'skb_queue_splice_tail_init()' has been made explicit. Previously it was
> hidden in 'sctp_skb_list_tail()'
> 
> Now, the code around it looks redundant. The '_init()' part of
> 'skb_queue_splice_tail_init()' should alreday do the same.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> Un-tested

Tested here with some netperf combinations, seems good.
Thanks

Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>

> ---
>  net/sctp/ulpqueue.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/net/sctp/ulpqueue.c b/net/sctp/ulpqueue.c
> index 877e55066f89..84d0fdaf7de9 100644
> --- a/net/sctp/ulpqueue.c
> +++ b/net/sctp/ulpqueue.c
> @@ -140,11 +140,8 @@ int sctp_clear_pd(struct sock *sk, struct sctp_association *asoc)
>  		 * we can go ahead and clear out the lobby in one shot
>  		 */
>  		if (!skb_queue_empty(&sp->pd_lobby)) {
> -			struct list_head *list;
>  			skb_queue_splice_tail_init(&sp->pd_lobby,
>  						   &sk->sk_receive_queue);
> -			list = (struct list_head *)&sctp_sk(sk)->pd_lobby;
> -			INIT_LIST_HEAD(list);
>  			return 1;
>  		}
>  	} else {
> -- 
> 2.7.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sctp" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

[toc] | [prev] | [next] | [standalone]


#1478416

FromNeil Horman <nhorman@tuxdriver.com>
Date2016-09-07 17:30 +0200
Message-ID<seMXw-1t1-35@gated-at.bofh.it>
In reply to#1475900
On Sun, Sep 04, 2016 at 11:38:13AM +0200, Christophe JAILLET wrote:
> In commit 311b21774f13 ("sctp: simplify sk_receive_queue locking"), a call
> to 'skb_queue_splice_tail_init()' has been made explicit. Previously it was
> hidden in 'sctp_skb_list_tail()'
> 
> Now, the code around it looks redundant. The '_init()' part of
> 'skb_queue_splice_tail_init()' should alreday do the same.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> Un-tested
> ---
>  net/sctp/ulpqueue.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/net/sctp/ulpqueue.c b/net/sctp/ulpqueue.c
> index 877e55066f89..84d0fdaf7de9 100644
> --- a/net/sctp/ulpqueue.c
> +++ b/net/sctp/ulpqueue.c
> @@ -140,11 +140,8 @@ int sctp_clear_pd(struct sock *sk, struct sctp_association *asoc)
>  		 * we can go ahead and clear out the lobby in one shot
>  		 */
>  		if (!skb_queue_empty(&sp->pd_lobby)) {
> -			struct list_head *list;
>  			skb_queue_splice_tail_init(&sp->pd_lobby,
>  						   &sk->sk_receive_queue);
> -			list = (struct list_head *)&sctp_sk(sk)->pd_lobby;
> -			INIT_LIST_HEAD(list);
>  			return 1;
>  		}
>  	} else {
> -- 
> 2.7.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sctp" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

Acked-by: Neil Horman <nhorman@tuxdriver.com>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web