public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: wangweidong <wangweidong1@huawei•com>
To: Joe Perches <joe@perches•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: Fri, 8 Nov 2013 11:07:05 +0800	[thread overview]
Message-ID: <527C5559.6040203@huawei.com> (raw)
In-Reply-To: <1383879644.9263.62.camel@joe-AO722>

On 2013/11/8 11:00, Joe Perches wrote:
> 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);
> }
> 
> 

Yeah, you are right. I will fix it in v2.
Thanks. 

> 
> 

  reply	other threads:[~2013-11-08  3:09 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
2013-11-08  3:07     ` wangweidong [this message]
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=527C5559.6040203@huawei.com \
    --to=wangweidong1@huawei$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=dingtianhong@huawei$(echo .)com \
    --cc=joe@perches$(echo .)com \
    --cc=linux-sctp@vger$(echo .)kernel.org \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=nhorman@tuxdriver$(echo .)com \
    --cc=vyasevich@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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