diff mbox

SUNRPC: Simplify rpc_alloc_iostats by removing pointless local variable

Message ID alpine.LNX.2.00.1011072205370.26247@swampdragon.chaosbits.net
State Not Applicable, archived
Delegated to: David Miller
Headers show

Commit Message

Jesper Juhl Nov. 7, 2010, 9:11 p.m. UTC
Hi,

We can simplify net/sunrpc/stats.c::rpc_alloc_iostats() a bit by getting 
rid of the unneeded local variable 'new'.


Please CC me on replies.


Signed-off-by: Jesper Juhl <jj@chaosbits.net>
---
 stats.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Jesper Juhl Nov. 10, 2010, 9:32 p.m. UTC | #1
On Sun, 7 Nov 2010, Jesper Juhl wrote:

> Hi,
> 
> We can simplify net/sunrpc/stats.c::rpc_alloc_iostats() a bit by getting 
> rid of the unneeded local variable 'new'.
> 
> 
> Please CC me on replies.
> 
> 
> Signed-off-by: Jesper Juhl <jj@chaosbits.net>
> ---
>  stats.c |    4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git 
> a/net/sunrpc/stats.c b/net/sunrpc/stats.c
> index f71a731..80df89d 100644
> --- a/net/sunrpc/stats.c
> +++ b/net/sunrpc/stats.c
> @@ -115,9 +115,7 @@ EXPORT_SYMBOL_GPL(svc_seq_show);
>   */
>  struct rpc_iostats *rpc_alloc_iostats(struct rpc_clnt *clnt)
>  {
> -	struct rpc_iostats *new;
> -	new = kcalloc(clnt->cl_maxproc, sizeof(struct rpc_iostats), GFP_KERNEL);
> -	return new;
> +	return kcalloc(clnt->cl_maxproc, sizeof(struct rpc_iostats), GFP_KERNEL);
>  }
>  EXPORT_SYMBOL_GPL(rpc_alloc_iostats);
>  
> 
> 

Ok, no response to this for a couple of days.
Is there some problem or did it just get missed?
Could someone merge this and push it up-stream, please, if there are no 
problems with it...
Chuck Lever Nov. 11, 2010, 3:57 p.m. UTC | #2
On Nov 10, 2010, at 4:32 PM, Jesper Juhl wrote:

> On Sun, 7 Nov 2010, Jesper Juhl wrote:
> 
>> Hi,
>> 
>> We can simplify net/sunrpc/stats.c::rpc_alloc_iostats() a bit by getting 
>> rid of the unneeded local variable 'new'.
>> 
>> 
>> Please CC me on replies.
>> 
>> 
>> Signed-off-by: Jesper Juhl <jj@chaosbits.net>
>> ---
>> stats.c |    4 +---
>> 1 file changed, 1 insertion(+), 3 deletions(-)
>> 
>> diff --git 
>> a/net/sunrpc/stats.c b/net/sunrpc/stats.c
>> index f71a731..80df89d 100644
>> --- a/net/sunrpc/stats.c
>> +++ b/net/sunrpc/stats.c
>> @@ -115,9 +115,7 @@ EXPORT_SYMBOL_GPL(svc_seq_show);
>>  */
>> struct rpc_iostats *rpc_alloc_iostats(struct rpc_clnt *clnt)
>> {
>> -	struct rpc_iostats *new;
>> -	new = kcalloc(clnt->cl_maxproc, sizeof(struct rpc_iostats), GFP_KERNEL);
>> -	return new;
>> +	return kcalloc(clnt->cl_maxproc, sizeof(struct rpc_iostats), GFP_KERNEL);
>> }
>> EXPORT_SYMBOL_GPL(rpc_alloc_iostats);
>> 
>> 
>> 
> 
> Ok, no response to this for a couple of days.
> Is there some problem or did it just get missed?
> Could someone merge this and push it up-stream, please, if there are no 
> problems with it...

The NFS maintainer is traveling.
diff mbox

Patch

diff --git 
a/net/sunrpc/stats.c b/net/sunrpc/stats.c
index f71a731..80df89d 100644
--- a/net/sunrpc/stats.c
+++ b/net/sunrpc/stats.c
@@ -115,9 +115,7 @@  EXPORT_SYMBOL_GPL(svc_seq_show);
  */
 struct rpc_iostats *rpc_alloc_iostats(struct rpc_clnt *clnt)
 {
-	struct rpc_iostats *new;
-	new = kcalloc(clnt->cl_maxproc, sizeof(struct rpc_iostats), GFP_KERNEL);
-	return new;
+	return kcalloc(clnt->cl_maxproc, sizeof(struct rpc_iostats), GFP_KERNEL);
 }
 EXPORT_SYMBOL_GPL(rpc_alloc_iostats);