Re: [PATCH 05/20] NFS: Clean up return code checking in nfs4_proc_exchange_id()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2012-04-23 at 16:53 -0400, Chuck Lever wrote:
> Clean up: prefer using the proper types in "if" expressions.
> 
> Signed-off-by: Chuck Lever <chuck.lever@xxxxxxxxxx>
> ---
> 
>  fs/nfs/nfs4proc.c |   16 ++++++++--------
>  1 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
> index 3778e4f..0af657d 100644
> --- a/fs/nfs/nfs4proc.c
> +++ b/fs/nfs/nfs4proc.c
> @@ -5038,30 +5038,30 @@ int nfs4_proc_exchange_id(struct nfs_client *clp, struct rpc_cred *cred)
>  
>  	res.server_scope = kzalloc(sizeof(struct nfs41_server_scope),
>  					GFP_KERNEL);
> -	if (unlikely(!res.server_scope)) {
> +	if (unlikely(res.server_scope == NULL)) {
>  		status = -ENOMEM;
>  		goto out;
>  	}
>  
>  	res.impl_id = kzalloc(sizeof(struct nfs41_impl_id), GFP_KERNEL);
> -	if (unlikely(!res.impl_id)) {
> +	if (unlikely(res.impl_id == NULL)) {
>  		status = -ENOMEM;
>  		goto out_server_scope;
>  	}
>  
>  	status = rpc_call_sync(clp->cl_rpcclient, &msg, RPC_TASK_TIMEOUT);
> -	if (!status)
> +	if (status == NFS4_OK)

No...

'status' is an ordinary integer value. It is not a special
NFS4_thisthatortheother...



-- 
Trond Myklebust
Linux NFS client maintainer

NetApp
Trond.Myklebust@xxxxxxxxxx
www.netapp.com

��.n��������+%������w��{.n�����{��w���jg��������ݢj����G�������j:+v���w�m������w�������h�����٥



[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux