public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Ding Tianhong <dingtianhong@huawei•com>
To: wangweidong <wangweidong1@huawei•com>
Cc: <davem@davemloft•net>, <Trond.Myklebust@netapp•com>,
	<bfields@fieldses•org>, <netdev@vger•kernel.org>,
	<linux-nfs@vger•kernel.org>
Subject: Re: [PACTH net-next] SUNRPC: remove an unnecessary if statement
Date: Thu, 24 Oct 2013 20:29:53 +0800	[thread overview]
Message-ID: <526912C1.6070502@huawei.com> (raw)
In-Reply-To: <52688768.9020703@huawei.com>

On 2013/10/24 10:35, wangweidong wrote:
> If req allocated failed just goto out_free, no need to check the
> 'i < num_prealloc'. There is just code simplification, no
> functional changes.
> 
> Signed-off-by: Wang Weidong <wangweidong1@huawei•com>
> ---
>  net/sunrpc/xprt.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
> index 095363e..a8e20de 100644
> --- a/net/sunrpc/xprt.c
> +++ b/net/sunrpc/xprt.c
> @@ -1087,11 +1087,9 @@ struct rpc_xprt *xprt_alloc(struct net *net, size_t size,
>  	for (i = 0; i < num_prealloc; i++) {
>  		req = kzalloc(sizeof(struct rpc_rqst), GFP_KERNEL);
>  		if (!req)
> -			break;
> +			goto out_free;
>  		list_add(&req->rq_list, &xprt->free);
>  	}
> -	if (i < num_prealloc)
> -		goto out_free;
>  	if (max_alloc > num_prealloc)
>  		xprt->max_reqs = max_alloc;
>  	else
> -- 1.7.12
> 
> 

Acked-by: Ding Tianhong <dingtianhong@huawei•com>

> 
> 
> .
> 

  reply	other threads:[~2013-10-24 12:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-24  2:35 [PACTH net-next] SUNRPC: remove an unnecessary if statement wangweidong
2013-10-24 12:29 ` Ding Tianhong [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-10-15  3:44 wangweidong

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=526912C1.6070502@huawei.com \
    --to=dingtianhong@huawei$(echo .)com \
    --cc=Trond.Myklebust@netapp$(echo .)com \
    --cc=bfields@fieldses$(echo .)org \
    --cc=davem@davemloft$(echo .)net \
    --cc=linux-nfs@vger$(echo .)kernel.org \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=wangweidong1@huawei$(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