linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Meyer <thomas@m3y3r.de>
To: trond.myklebust@primarydata.com, anna.schumaker@netapp.com,
	linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] NFS: Fix bool initialization/comparison
Date: Sat, 07 Oct 2017 16:02:21 +0200	[thread overview]
Message-ID: <1507383097084-201334057-10-diffsplit-thomas@m3y3r.de> (raw)
In-Reply-To: <1507383097081-778026979-0-diffsplit-thomas@m3y3r.de>

Bool initializations should use true and false. Bool tests don't need
comparisons.

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
---

diff -u -p a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c
--- a/fs/nfs/callback_proc.c
+++ b/fs/nfs/callback_proc.c
@@ -439,7 +439,7 @@ static bool referring_call_exists(struct
 				  uint32_t nrclists,
 				  struct referring_call_list *rclists)
 {
-	bool status = 0;
+	bool status = false;
 	int i, j;
 	struct nfs4_session *session;
 	struct nfs4_slot_table *tbl;
diff -u -p a/fs/nfs/dir.c b/fs/nfs/dir.c
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -253,7 +253,7 @@ int nfs_readdir_search_for_pos(struct nf
 	desc->cache_entry_index = index;
 	return 0;
 out_eof:
-	desc->eof = 1;
+	desc->eof = true;
 	return -EBADCOOKIE;
 }
 
@@ -307,7 +307,7 @@ int nfs_readdir_search_for_cookie(struct
 	if (array->eof_index >= 0) {
 		status = -EBADCOOKIE;
 		if (*desc->dir_cookie == array->last_cookie)
-			desc->eof = 1;
+			desc->eof = true;
 	}
 out:
 	return status;
@@ -761,7 +761,7 @@ int nfs_do_filldir(nfs_readdir_descripto
 		ent = &array->array[i];
 		if (!dir_emit(desc->ctx, ent->string.name, ent->string.len,
 		    nfs_compat_user_ino64(ent->ino), ent->d_type)) {
-			desc->eof = 1;
+			desc->eof = true;
 			break;
 		}
 		desc->ctx->pos++;
@@ -773,7 +773,7 @@ int nfs_do_filldir(nfs_readdir_descripto
 			ctx->duped = 1;
 	}
 	if (array->eof_index >= 0)
-		desc->eof = 1;
+		desc->eof = true;
 
 	kunmap(desc->page);
 	cache_page_release(desc);
@@ -873,7 +873,7 @@ static int nfs_readdir(struct file *file
 		if (res == -EBADCOOKIE) {
 			res = 0;
 			/* This means either end of directory */
-			if (*desc->dir_cookie && desc->eof == 0) {
+			if (*desc->dir_cookie && !desc->eof) {
 				/* Or that the server has 'lost' a cookie */
 				res = uncached_readdir(desc);
 				if (res == 0)
diff -u -p a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c
--- a/fs/nfs/nfs4client.c
+++ b/fs/nfs/nfs4client.c
@@ -793,7 +793,7 @@ nfs4_find_client_sessionid(struct net *n
 
 	spin_lock(&nn->nfs_client_lock);
 	list_for_each_entry(clp, &nn->nfs_client_list, cl_share_link) {
-		if (nfs4_cb_match_client(addr, clp, minorversion) == false)
+		if (!nfs4_cb_match_client(addr, clp, minorversion))
 			continue;
 
 		if (!nfs4_has_session(clp))
diff -u -p a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -1513,7 +1513,7 @@ pnfs_lseg_range_match(const struct pnfs_
 	if ((range->iomode == IOMODE_RW &&
 	     ls_range->iomode != IOMODE_RW) ||
 	    (range->iomode != ls_range->iomode &&
-	     strict_iomode == true) ||
+	     strict_iomode) ||
 	    !pnfs_lseg_range_intersecting(ls_range, range))
 		return 0;
 

  parent reply	other threads:[~2017-10-07 14:25 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-07 14:02 Cocci spatch "boolinit" - v4.14-rc1 Thomas Meyer
2017-10-07 14:02 ` [PATCH] f2fs: Fix bool initialization/comparison Thomas Meyer
2017-10-07 14:33   ` [f2fs-dev] " Ju Hyung Park
2017-10-07 19:30     ` Joe Perches
2017-10-09  1:48       ` Chao Yu
2017-10-10 17:41         ` Jaegeuk Kim
2017-10-07 14:02 ` [PATCH] cifs: " Thomas Meyer
2017-10-10  1:14   ` Nico Kadel-Garcia
2017-10-07 14:02 ` [PATCH] ima: " Thomas Meyer
2017-10-07 14:02 ` [PATCH] nfsd: " Thomas Meyer
2017-10-07 14:02 ` Thomas Meyer [this message]
2017-10-07 14:02 ` [PATCH] pstore: " Thomas Meyer
2018-11-29 23:21   ` Kees Cook
2017-10-07 14:02 ` [PATCH] afs: " Thomas Meyer
2017-10-07 14:02 ` [PATCH] xfs: " Thomas Meyer
2017-10-09 14:24   ` Brian Foster
2017-10-07 14:02 ` [PATCH] ceph: " Thomas Meyer
2017-10-09  1:52   ` Yan, Zheng
2017-10-07 14:02 ` [PATCH] bfq: " Thomas Meyer
2017-10-07 14:02 ` [PATCH] proc: " Thomas Meyer
2017-10-07 14:02 ` [PATCH] exofs: " Thomas Meyer
2017-10-07 14:02 ` [PATCH] apparmor: " Thomas Meyer
2017-10-07 17:18   ` John Johansen
2017-10-07 14:02 ` [PATCH] ext4: " Thomas Meyer
2017-10-07 14:02 ` [PATCH] btrfs: " Thomas Meyer
2017-10-09 16:05   ` David Sterba
2017-10-07 14:02 ` [PATCH] selinux: " Thomas Meyer
2017-10-10 23:17   ` Casey Schaufler
2017-10-10 23:19   ` Casey Schaufler
2017-10-13 22:40     ` Paul Moore
2017-10-07 14:02 ` [PATCH] configfs: " Thomas Meyer
2017-10-19 14:08   ` Christoph Hellwig
2017-10-10 15:19 ` [PATCH] afs: " David Howells

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1507383097084-201334057-10-diffsplit-thomas@m3y3r.de \
    --to=thomas@m3y3r.de \
    --cc=anna.schumaker@netapp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trond.myklebust@primarydata.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).