All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Wang Weidong <wangweidong1@huawei.com>,
	davem@davemloft.net, nhorman@tuxdriver.com, vyasevich@gmail.com
Cc: dingtianhong@huawei.com, linux-sctp@vger.kernel.org,
	netdev@vger.kernel.org
Subject: Re: [PATCH 1/4] sctp: merge two if statements to one
Date: Fri, 25 Oct 2013 13:04:05 +0000	[thread overview]
Message-ID: <526A6C45.3080200@cogentembedded.com> (raw)
In-Reply-To: <1382665805-13952-2-git-send-email-wangweidong1@huawei.com>

Hello.

On 25-10-2013 5:50, Wang Weidong wrote:

> Two if statements do the same work, maybe we can merge them to
> one. There is just code simplification, no functional changes.

> Signed-off-by: Wang Weidong <wangweidong1@huawei.com>
> ---
>   net/sctp/auth.c | 12 ++++--------
>   1 file changed, 4 insertions(+), 8 deletions(-)

    I understand what I noticed below is not your typos but maybe it's time to 
fix them?

> diff --git a/net/sctp/auth.c b/net/sctp/auth.c
> index 8c4fa5d..19fb0ae 100644
> --- a/net/sctp/auth.c
> +++ b/net/sctp/auth.c
> @@ -539,18 +539,14 @@ struct sctp_hmac *sctp_auth_asoc_get_hmac(const struct sctp_association *asoc)
>   	for (i = 0; i < n_elt; i++) {
>   		id = ntohs(hmacs->hmac_ids[i]);
>
> -		/* Check the id is in the supported range */
> -		if (id > SCTP_AUTH_HMAC_ID_MAX) {
> -			id = 0;
> -			continue;
> -		}
> -
> -		/* See is we support the id.  Supported IDs have name and
> +		/* Check the id is in the supported range. And
> +		 * see is we support the id.  Supported IDs have name and

    s/is/if/.

>   		 * length fields set, so that we can allocated and use

    s/allocated/allocate/.

WBR, Sergei


WARNING: multiple messages have this Message-ID (diff)
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Wang Weidong <wangweidong1@huawei.com>,
	davem@davemloft.net, nhorman@tuxdriver.com, vyasevich@gmail.com
Cc: dingtianhong@huawei.com, linux-sctp@vger.kernel.org,
	netdev@vger.kernel.org
Subject: Re: [PATCH 1/4] sctp: merge two if statements to one
Date: Fri, 25 Oct 2013 17:04:05 +0400	[thread overview]
Message-ID: <526A6C45.3080200@cogentembedded.com> (raw)
In-Reply-To: <1382665805-13952-2-git-send-email-wangweidong1@huawei.com>

Hello.

On 25-10-2013 5:50, Wang Weidong wrote:

> Two if statements do the same work, maybe we can merge them to
> one. There is just code simplification, no functional changes.

> Signed-off-by: Wang Weidong <wangweidong1@huawei.com>
> ---
>   net/sctp/auth.c | 12 ++++--------
>   1 file changed, 4 insertions(+), 8 deletions(-)

    I understand what I noticed below is not your typos but maybe it's time to 
fix them?

> diff --git a/net/sctp/auth.c b/net/sctp/auth.c
> index 8c4fa5d..19fb0ae 100644
> --- a/net/sctp/auth.c
> +++ b/net/sctp/auth.c
> @@ -539,18 +539,14 @@ struct sctp_hmac *sctp_auth_asoc_get_hmac(const struct sctp_association *asoc)
>   	for (i = 0; i < n_elt; i++) {
>   		id = ntohs(hmacs->hmac_ids[i]);
>
> -		/* Check the id is in the supported range */
> -		if (id > SCTP_AUTH_HMAC_ID_MAX) {
> -			id = 0;
> -			continue;
> -		}
> -
> -		/* See is we support the id.  Supported IDs have name and
> +		/* Check the id is in the supported range. And
> +		 * see is we support the id.  Supported IDs have name and

    s/is/if/.

>   		 * length fields set, so that we can allocated and use

    s/allocated/allocate/.

WBR, Sergei

  reply	other threads:[~2013-10-25 13:04 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-25  1:50 [PATCH 0/4] sctp: do some clean up and fix comments Wang Weidong
2013-10-25  1:50 ` Wang Weidong
2013-10-25  1:50 ` [PATCH 1/4] sctp: merge two if statements to one Wang Weidong
2013-10-25  1:50   ` Wang Weidong
2013-10-25 13:04   ` Sergei Shtylyov [this message]
2013-10-25 13:04     ` Sergei Shtylyov
2013-10-26  2:55     ` wangweidong
2013-10-26  2:55       ` wangweidong
2013-10-25 23:40   ` Vlad Yasevich
2013-10-25 23:40     ` Vlad Yasevich
2013-10-26  2:59     ` wangweidong
2013-10-26  2:59       ` wangweidong
2013-10-25  1:50 ` [PATCH 2/4] sctp: remove the repeat initialize with 0 Wang Weidong
2013-10-25  1:50   ` Wang Weidong
2013-10-25 23:42   ` Vlad Yasevich
2013-10-25 23:42     ` Vlad Yasevich
2013-10-25  1:50 ` [PATCH 3/4] sctp: fix some comments in associola.c Wang Weidong
2013-10-25  1:50   ` Wang Weidong
2013-10-25 23:43   ` Vlad Yasevich
2013-10-25 23:43     ` Vlad Yasevich
2013-10-25  1:50 ` [PATCH 4/4] sctp: fix comment in chunk.c Wang Weidong
2013-10-25  1:50   ` Wang Weidong
2013-10-25 23:45   ` Vlad Yasevich
2013-10-25 23:45     ` Vlad Yasevich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=526A6C45.3080200@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=davem@davemloft.net \
    --cc=dingtianhong@huawei.com \
    --cc=linux-sctp@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@tuxdriver.com \
    --cc=vyasevich@gmail.com \
    --cc=wangweidong1@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.