Skip to content

Commit 574940d

Browse files
thomasmeygregkh
authored andcommitted
NFS: Fix bool initialization/comparison
[ Upstream commit 6089dd0 ] Bool initializations should use true and false. Bool tests don't need comparisons. Signed-off-by: Thomas Meyer <[email protected]> Signed-off-by: Anna Schumaker <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 67a56e9 commit 574940d

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

fs/nfs/callback_proc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ static bool referring_call_exists(struct nfs_client *clp,
419419
uint32_t nrclists,
420420
struct referring_call_list *rclists)
421421
{
422-
bool status = 0;
422+
bool status = false;
423423
int i, j;
424424
struct nfs4_session *session;
425425
struct nfs4_slot_table *tbl;

fs/nfs/dir.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ int nfs_readdir_search_for_pos(struct nfs_cache_array *array, nfs_readdir_descri
289289
desc->cache_entry_index = index;
290290
return 0;
291291
out_eof:
292-
desc->eof = 1;
292+
desc->eof = true;
293293
return -EBADCOOKIE;
294294
}
295295

@@ -343,7 +343,7 @@ int nfs_readdir_search_for_cookie(struct nfs_cache_array *array, nfs_readdir_des
343343
if (array->eof_index >= 0) {
344344
status = -EBADCOOKIE;
345345
if (*desc->dir_cookie == array->last_cookie)
346-
desc->eof = 1;
346+
desc->eof = true;
347347
}
348348
out:
349349
return status;
@@ -812,7 +812,7 @@ int nfs_do_filldir(nfs_readdir_descriptor_t *desc)
812812
ent = &array->array[i];
813813
if (!dir_emit(desc->ctx, ent->string.name, ent->string.len,
814814
nfs_compat_user_ino64(ent->ino), ent->d_type)) {
815-
desc->eof = 1;
815+
desc->eof = true;
816816
break;
817817
}
818818
desc->ctx->pos++;
@@ -824,7 +824,7 @@ int nfs_do_filldir(nfs_readdir_descriptor_t *desc)
824824
ctx->duped = 1;
825825
}
826826
if (array->eof_index >= 0)
827-
desc->eof = 1;
827+
desc->eof = true;
828828

829829
nfs_readdir_release_array(desc->page);
830830
out:
@@ -925,7 +925,7 @@ static int nfs_readdir(struct file *file, struct dir_context *ctx)
925925
if (res == -EBADCOOKIE) {
926926
res = 0;
927927
/* This means either end of directory */
928-
if (*desc->dir_cookie && desc->eof == 0) {
928+
if (*desc->dir_cookie && !desc->eof) {
929929
/* Or that the server has 'lost' a cookie */
930930
res = uncached_readdir(desc);
931931
if (res == 0)

fs/nfs/nfs4client.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -847,7 +847,7 @@ nfs4_find_client_sessionid(struct net *net, const struct sockaddr *addr,
847847

848848
spin_lock(&nn->nfs_client_lock);
849849
list_for_each_entry(clp, &nn->nfs_client_list, cl_share_link) {
850-
if (nfs4_cb_match_client(addr, clp, minorversion) == false)
850+
if (!nfs4_cb_match_client(addr, clp, minorversion))
851851
continue;
852852

853853
if (!nfs4_has_session(clp))

fs/nfs/pnfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1436,7 +1436,7 @@ pnfs_lseg_range_match(const struct pnfs_layout_range *ls_range,
14361436
if ((range->iomode == IOMODE_RW &&
14371437
ls_range->iomode != IOMODE_RW) ||
14381438
(range->iomode != ls_range->iomode &&
1439-
strict_iomode == true) ||
1439+
strict_iomode) ||
14401440
!pnfs_lseg_range_intersecting(ls_range, range))
14411441
return 0;
14421442

0 commit comments

Comments
 (0)