netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Wang Weidong <wangweidong1@huawei.com>
Cc: vyasevich@gmail.com, nhorman@tuxdriver.com,
	dingtianhong@huawei.com, davem@davemloft.net,
	linux-sctp@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH net-next 2/5] sctp: remove the else path
Date: Thu, 07 Nov 2013 19:00:44 -0800	[thread overview]
Message-ID: <1383879644.9263.62.camel@joe-AO722> (raw)
In-Reply-To: <1383879310-22792-3-git-send-email-wangweidong1@huawei.com>

On Fri, 2013-11-08 at 10:55 +0800, Wang Weidong wrote:
> Make the code more simplification.
> 
> Signed-off-by: Wang Weidong <wangweidong1@huawei.com>
> ---
>  net/sctp/associola.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/net/sctp/associola.c b/net/sctp/associola.c
> index 667f984..2d53d4c 100644
> --- a/net/sctp/associola.c
> +++ b/net/sctp/associola.c
> @@ -954,15 +954,13 @@ int sctp_cmp_addr_exact(const union sctp_addr *ss1,
>   */
>  struct sctp_chunk *sctp_get_ecne_prepend(struct sctp_association *asoc)
>  {
> -	struct sctp_chunk *chunk;
> +	struct sctp_chunk *chunk = NULL;
>  
>  	/* Send ECNE if needed.
>  	 * Not being able to allocate a chunk here is not deadly.
>  	 */
>  	if (asoc->need_ecne)
>  		chunk = sctp_make_ecne(asoc, asoc->last_ecne_tsn);
> -	else
> -		chunk = NULL;
>  
>  	return chunk;
>  }

If you really want to make the code simple how about:

struct sctp_chunk *sctp_get_ecne_prepend(struct sctp_association *asoc)
{
	if (!asoc->need_ecne)
		return NULL;

	return sctp_make_ecne(asoc, asoc->last_ecne_tsn);
}

  reply	other threads:[~2013-11-08  3:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-08  2:55 [PATCH net-next 0/5] sctp: fix and clean up Wang Weidong
2013-11-08  2:55 ` [PATCH net-next 1/5] sctp: remove the duplicate initialize Wang Weidong
2013-11-08  2:55 ` [PATCH net-next 2/5] sctp: remove the else path Wang Weidong
2013-11-08  3:00   ` Joe Perches [this message]
2013-11-08  3:07     ` wangweidong
2013-11-08 19:19   ` Sergei Shtylyov
2013-11-11  1:57     ` wangweidong
2013-11-08  2:55 ` [PATCH net-next 3/5] sctp: if we done update ssnmap, free the new ssnmap Wang Weidong
2013-11-08  3:49   ` Vlad Yasevich
2013-11-08  4:30     ` wangweidong
2013-11-08  2:55 ` [PATCH net-next 4/5] sctp: convert sctp_peer_needs_update to boolean Wang Weidong
2013-11-08  2:55 ` [PATCH net-next 5/5] sctp: fix some typos in associola.c Wang Weidong
2013-11-08  6:41 ` [PATCH net-next 0/5] sctp: fix and clean up David Miller

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=1383879644.9263.62.camel@joe-AO722 \
    --to=joe@perches.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 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).