提交 51d87bc2 编写于 作者: F Fengguang Wu 提交者: J. Bruce Fields

nfsd: fix boolreturn.cocci warnings

fs/nfsd/nfs4state.c:926:8-9: WARNING: return of 0/1 in function 'nfs4_delegation_exists' with return type bool
fs/nfsd/nfs4state.c:2955:9-10: WARNING: return of 0/1 in function 'nfsd4_compound_in_session' with return type bool

 Return statements in functions returning bool should use
 true/false instead of 1/0.
Generated by: scripts/coccinelle/misc/boolreturn.cocci

Fixes: 68b18f52 ("nfsd: make nfs4_get_existing_delegation less confusing")
Signed-off-by: NFengguang Wu <fengguang.wu@intel.com>
Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
[bfields: also fix -EAGAIN]
Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
上级 353601e7
...@@ -935,10 +935,10 @@ nfs4_delegation_exists(struct nfs4_client *clp, struct nfs4_file *fp) ...@@ -935,10 +935,10 @@ nfs4_delegation_exists(struct nfs4_client *clp, struct nfs4_file *fp)
list_for_each_entry(searchdp, &fp->fi_delegations, dl_perfile) { list_for_each_entry(searchdp, &fp->fi_delegations, dl_perfile) {
searchclp = searchdp->dl_stid.sc_client; searchclp = searchdp->dl_stid.sc_client;
if (clp == searchclp) { if (clp == searchclp) {
return -EAGAIN; return true;
} }
} }
return 0; return false;
} }
/** /**
...@@ -2958,7 +2958,7 @@ __be32 nfsd4_bind_conn_to_session(struct svc_rqst *rqstp, ...@@ -2958,7 +2958,7 @@ __be32 nfsd4_bind_conn_to_session(struct svc_rqst *rqstp,
static bool nfsd4_compound_in_session(struct nfsd4_session *session, struct nfs4_sessionid *sid) static bool nfsd4_compound_in_session(struct nfsd4_session *session, struct nfs4_sessionid *sid)
{ {
if (!session) if (!session)
return 0; return false;
return !memcmp(sid, &session->se_sessionid, sizeof(*sid)); return !memcmp(sid, &session->se_sessionid, sizeof(*sid));
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册