Skip to content

Commit 5f7b839

Browse files
Lotte-Baichucklever
authored andcommitted
SUNRPC: Return true/false (not 1/0) from bool functions
Return boolean values ("true" or "false") instead of 1 or 0 from bool functions. This fixes the following warnings from coccicheck: ./fs/nfsd/nfs2acl.c:289:9-10: WARNING: return of 0/1 in function 'nfsaclsvc_encode_accessres' with return type bool ./fs/nfsd/nfs2acl.c:252:9-10: WARNING: return of 0/1 in function 'nfsaclsvc_encode_getaclres' with return type bool Signed-off-by: Haowen Bai <baihaowen@meizu.com> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
1 parent 4fc5f53 commit 5f7b839

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

fs/nfsd/nfs2acl.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -249,34 +249,34 @@ nfsaclsvc_encode_getaclres(struct svc_rqst *rqstp, struct xdr_stream *xdr)
249249
int w;
250250

251251
if (!svcxdr_encode_stat(xdr, resp->status))
252-
return 0;
252+
return false;
253253

254254
if (dentry == NULL || d_really_is_negative(dentry))
255-
return 1;
255+
return true;
256256
inode = d_inode(dentry);
257257

258258
if (!svcxdr_encode_fattr(rqstp, xdr, &resp->fh, &resp->stat))
259-
return 0;
259+
return false;
260260
if (xdr_stream_encode_u32(xdr, resp->mask) < 0)
261-
return 0;
261+
return false;
262262

263263
rqstp->rq_res.page_len = w = nfsacl_size(
264264
(resp->mask & NFS_ACL) ? resp->acl_access : NULL,
265265
(resp->mask & NFS_DFACL) ? resp->acl_default : NULL);
266266
while (w > 0) {
267267
if (!*(rqstp->rq_next_page++))
268-
return 1;
268+
return true;
269269
w -= PAGE_SIZE;
270270
}
271271

272272
if (!nfs_stream_encode_acl(xdr, inode, resp->acl_access,
273273
resp->mask & NFS_ACL, 0))
274-
return 0;
274+
return false;
275275
if (!nfs_stream_encode_acl(xdr, inode, resp->acl_default,
276276
resp->mask & NFS_DFACL, NFS_ACL_DEFAULT))
277-
return 0;
277+
return false;
278278

279-
return 1;
279+
return true;
280280
}
281281

282282
/* ACCESS */
@@ -286,17 +286,17 @@ nfsaclsvc_encode_accessres(struct svc_rqst *rqstp, struct xdr_stream *xdr)
286286
struct nfsd3_accessres *resp = rqstp->rq_resp;
287287

288288
if (!svcxdr_encode_stat(xdr, resp->status))
289-
return 0;
289+
return false;
290290
switch (resp->status) {
291291
case nfs_ok:
292292
if (!svcxdr_encode_fattr(rqstp, xdr, &resp->fh, &resp->stat))
293-
return 0;
293+
return false;
294294
if (xdr_stream_encode_u32(xdr, resp->access) < 0)
295-
return 0;
295+
return false;
296296
break;
297297
}
298298

299-
return 1;
299+
return true;
300300
}
301301

302302
/*

0 commit comments

Comments
 (0)