netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] sctp: no need to check asoc_id before calling sctp_assoc_set_id
@ 2017-05-23  6:30 Xin Long
  2017-05-23 18:04 ` Marcelo Ricardo Leitner
  0 siblings, 1 reply; 3+ messages in thread
From: Xin Long @ 2017-05-23  6:30 UTC (permalink / raw)
  To: network dev, linux-sctp; +Cc: Marcelo Ricardo Leitner, Neil Horman, davem

sctp_assoc_set_id has already done the asoc_id check in the beginning
when processing dupcook, no need to do the same check before calling
it.

Signed-off-by: Xin Long <lucien.xin@gmail.com>
---
 net/sctp/associola.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/net/sctp/associola.c b/net/sctp/associola.c
index a9708da..ce2a3ec 100644
--- a/net/sctp/associola.c
+++ b/net/sctp/associola.c
@@ -1181,12 +1181,8 @@ void sctp_assoc_update(struct sctp_association *asoc,
 			new->stream = NULL;
 		}
 
-		if (!asoc->assoc_id) {
-			/* get a new association id since we don't have one
-			 * yet.
-			 */
-			sctp_assoc_set_id(asoc, GFP_ATOMIC);
-		}
+		/* get a new association id if we don't have one yet. */
+		sctp_assoc_set_id(asoc, GFP_ATOMIC);
 	}
 
 	/* SCTP-AUTH: Save the peer parameters from the new associations
-- 
2.1.0

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

* Re: [PATCH net-next] sctp: no need to check asoc_id before calling sctp_assoc_set_id
  2017-05-23  6:30 [PATCH net-next] sctp: no need to check asoc_id before calling sctp_assoc_set_id Xin Long
@ 2017-05-23 18:04 ` Marcelo Ricardo Leitner
  2017-05-23 18:25   ` Xin Long
  0 siblings, 1 reply; 3+ messages in thread
From: Marcelo Ricardo Leitner @ 2017-05-23 18:04 UTC (permalink / raw)
  To: Xin Long; +Cc: network dev, linux-sctp, Neil Horman, davem

Hi,

On Tue, May 23, 2017 at 02:30:32PM +0800, Xin Long wrote:
> sctp_assoc_set_id has already done the asoc_id check in the beginning
                  s/^^^^^^^^^^^^^^^^/does/
Very important to use the right tense here as otherwise it gives the
impression that the check was already made, which is not true.

> when processing dupcook, no need to do the same check before calling
                s/^^^^^^^/dupcookie/

other than this, LGTM, including the comment update.

  Marcelo

> it.
> 
> Signed-off-by: Xin Long <lucien.xin@gmail.com>
> ---
>  net/sctp/associola.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/net/sctp/associola.c b/net/sctp/associola.c
> index a9708da..ce2a3ec 100644
> --- a/net/sctp/associola.c
> +++ b/net/sctp/associola.c
> @@ -1181,12 +1181,8 @@ void sctp_assoc_update(struct sctp_association *asoc,
>  			new->stream = NULL;
>  		}
>  
> -		if (!asoc->assoc_id) {
> -			/* get a new association id since we don't have one
> -			 * yet.
> -			 */
> -			sctp_assoc_set_id(asoc, GFP_ATOMIC);
> -		}
> +		/* get a new association id if we don't have one yet. */
> +		sctp_assoc_set_id(asoc, GFP_ATOMIC);
>  	}
>  
>  	/* SCTP-AUTH: Save the peer parameters from the new associations
> -- 
> 2.1.0
> 
> --
> 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
> 

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

* Re: [PATCH net-next] sctp: no need to check asoc_id before calling sctp_assoc_set_id
  2017-05-23 18:04 ` Marcelo Ricardo Leitner
@ 2017-05-23 18:25   ` Xin Long
  0 siblings, 0 replies; 3+ messages in thread
From: Xin Long @ 2017-05-23 18:25 UTC (permalink / raw)
  To: Marcelo Ricardo Leitner; +Cc: network dev, linux-sctp, Neil Horman, davem

On Wed, May 24, 2017 at 2:04 AM, Marcelo Ricardo Leitner
<marcelo.leitner@gmail.com> wrote:
[...]
>
> On Tue, May 23, 2017 at 02:30:32PM +0800, Xin Long wrote:
>> sctp_assoc_set_id has already done the asoc_id check in the beginning
>                   s/^^^^^^^^^^^^^^^^/does/
> Very important to use the right tense here as otherwise it gives the
> impression that the check was already made, which is not true.
Sure, will change it and post v2.
But may be later than another two patches in my hands.

>
>> when processing dupcook, no need to do the same check before calling
>                 s/^^^^^^^/dupcookie/
Oh, can't believe it's still here ;)
will correct it. thanks.

>
> other than this, LGTM, including the comment update.
>
>   Marcelo
>
>> it.
>>
>> Signed-off-by: Xin Long <lucien.xin@gmail.com>
>> ---
>>  net/sctp/associola.c | 8 ++------
>>  1 file changed, 2 insertions(+), 6 deletions(-)
>>
>> diff --git a/net/sctp/associola.c b/net/sctp/associola.c
>> index a9708da..ce2a3ec 100644
>> --- a/net/sctp/associola.c
>> +++ b/net/sctp/associola.c
>> @@ -1181,12 +1181,8 @@ void sctp_assoc_update(struct sctp_association *asoc,
>>                       new->stream = NULL;
>>               }
>>
>> -             if (!asoc->assoc_id) {
>> -                     /* get a new association id since we don't have one
>> -                      * yet.
>> -                      */
>> -                     sctp_assoc_set_id(asoc, GFP_ATOMIC);
>> -             }
>> +             /* get a new association id if we don't have one yet. */
>> +             sctp_assoc_set_id(asoc, GFP_ATOMIC);
>>       }
>>
>>       /* SCTP-AUTH: Save the peer parameters from the new associations
>> --
>> 2.1.0
>>
>> --
>> 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
>>

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

end of thread, other threads:[~2017-05-23 18:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-23  6:30 [PATCH net-next] sctp: no need to check asoc_id before calling sctp_assoc_set_id Xin Long
2017-05-23 18:04 ` Marcelo Ricardo Leitner
2017-05-23 18:25   ` Xin Long

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).