linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] nfsd: use true,false for bool variable
@ 2019-12-25  3:19 zhengbin
  2019-12-25  3:19 ` [PATCH 1/3] nfsd: use true,false for bool variable in vfs.c zhengbin
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: zhengbin @ 2019-12-25  3:19 UTC (permalink / raw)
  To: bfields, chuck.lever, linux-nfs; +Cc: zhengbin13

zhengbin (3):
  nfsd: use true,false for bool variable in vfs.c
  nfsd: use true,false for bool variable in nfs4proc.c
  nfsd: use true,false for bool variable in nfssvc.c

 fs/nfsd/nfs4proc.c | 4 ++--
 fs/nfsd/nfssvc.c   | 6 +++---
 fs/nfsd/vfs.c      | 6 +++---
 3 files changed, 8 insertions(+), 8 deletions(-)

--
2.7.4


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/3] nfsd: use true,false for bool variable in vfs.c
  2019-12-25  3:19 [PATCH 0/3] nfsd: use true,false for bool variable zhengbin
@ 2019-12-25  3:19 ` zhengbin
  2019-12-25  3:19 ` [PATCH 2/3] nfsd: use true,false for bool variable in nfs4proc.c zhengbin
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: zhengbin @ 2019-12-25  3:19 UTC (permalink / raw)
  To: bfields, chuck.lever, linux-nfs; +Cc: zhengbin13

Fixes coccicheck warning:

fs/nfsd/vfs.c:1389:5-13: WARNING: Assignment of 0/1 to bool variable
fs/nfsd/vfs.c:1398:5-13: WARNING: Assignment of 0/1 to bool variable
fs/nfsd/vfs.c:1415:2-10: WARNING: Assignment of 0/1 to bool variable

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
 fs/nfsd/vfs.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index c0dc491..891e09f 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -1386,7 +1386,7 @@ do_nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp,
 			    && d_inode(dchild)->i_atime.tv_sec == v_atime
 			    && d_inode(dchild)->i_size  == 0 ) {
 				if (created)
-					*created = 1;
+					*created = true;
 				break;
 			}
 			/* fall through */
@@ -1395,7 +1395,7 @@ do_nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp,
 			    && d_inode(dchild)->i_atime.tv_sec == v_atime
 			    && d_inode(dchild)->i_size  == 0 ) {
 				if (created)
-					*created = 1;
+					*created = true;
 				goto set_attr;
 			}
 			/* fall through */
@@ -1412,7 +1412,7 @@ do_nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp,
 		goto out_nfserr;
 	}
 	if (created)
-		*created = 1;
+		*created = true;

 	nfsd_check_ignore_resizing(iap);

--
2.7.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/3] nfsd: use true,false for bool variable in nfs4proc.c
  2019-12-25  3:19 [PATCH 0/3] nfsd: use true,false for bool variable zhengbin
  2019-12-25  3:19 ` [PATCH 1/3] nfsd: use true,false for bool variable in vfs.c zhengbin
@ 2019-12-25  3:19 ` zhengbin
  2019-12-25  3:19 ` [PATCH 3/3] nfsd: use true,false for bool variable in nfssvc.c zhengbin
  2020-01-03 16:23 ` [PATCH 0/3] nfsd: use true,false for bool variable J. Bruce Fields
  3 siblings, 0 replies; 5+ messages in thread
From: zhengbin @ 2019-12-25  3:19 UTC (permalink / raw)
  To: bfields, chuck.lever, linux-nfs; +Cc: zhengbin13

Fixes coccicheck warning:

fs/nfsd/nfs4proc.c:235:1-18: WARNING: Assignment of 0/1 to bool variable
fs/nfsd/nfs4proc.c:368:1-17: WARNING: Assignment of 0/1 to bool variable

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
 fs/nfsd/nfs4proc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index 4798667..d7d910e 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -232,7 +232,7 @@ do_open_lookup(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, stru
 	if (!*resfh)
 		return nfserr_jukebox;
 	fh_init(*resfh, NFS4_FHSIZE);
-	open->op_truncate = 0;
+	open->op_truncate = false;

 	if (open->op_create) {
 		/* FIXME: check session persistence and pnfs flags.
@@ -365,7 +365,7 @@ nfsd4_open(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
 	if (open->op_create && open->op_claim_type != NFS4_OPEN_CLAIM_NULL)
 		return nfserr_inval;

-	open->op_created = 0;
+	open->op_created = false;
 	/*
 	 * RFC5661 18.51.3
 	 * Before RECLAIM_COMPLETE done, server should deny new lock
--
2.7.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/3] nfsd: use true,false for bool variable in nfssvc.c
  2019-12-25  3:19 [PATCH 0/3] nfsd: use true,false for bool variable zhengbin
  2019-12-25  3:19 ` [PATCH 1/3] nfsd: use true,false for bool variable in vfs.c zhengbin
  2019-12-25  3:19 ` [PATCH 2/3] nfsd: use true,false for bool variable in nfs4proc.c zhengbin
@ 2019-12-25  3:19 ` zhengbin
  2020-01-03 16:23 ` [PATCH 0/3] nfsd: use true,false for bool variable J. Bruce Fields
  3 siblings, 0 replies; 5+ messages in thread
From: zhengbin @ 2019-12-25  3:19 UTC (permalink / raw)
  To: bfields, chuck.lever, linux-nfs; +Cc: zhengbin13

Fixes coccicheck warning:

fs/nfsd/nfssvc.c:394:2-14: WARNING: Assignment of 0/1 to bool variable
fs/nfsd/nfssvc.c:407:2-14: WARNING: Assignment of 0/1 to bool variable
fs/nfsd/nfssvc.c:422:2-14: WARNING: Assignment of 0/1 to bool variable

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
 fs/nfsd/nfssvc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
index e8bee8f..decfda0 100644
--- a/fs/nfsd/nfssvc.c
+++ b/fs/nfsd/nfssvc.c
@@ -391,7 +391,7 @@ static int nfsd_startup_net(int nrservs, struct net *net, const struct cred *cre
 		ret = lockd_up(net, cred);
 		if (ret)
 			goto out_socks;
-		nn->lockd_up = 1;
+		nn->lockd_up = true;
 	}

 	ret = nfs4_state_start_net(net);
@@ -404,7 +404,7 @@ static int nfsd_startup_net(int nrservs, struct net *net, const struct cred *cre
 out_lockd:
 	if (nn->lockd_up) {
 		lockd_down(net);
-		nn->lockd_up = 0;
+		nn->lockd_up = false;
 	}
 out_socks:
 	nfsd_shutdown_generic();
@@ -419,7 +419,7 @@ static void nfsd_shutdown_net(struct net *net)
 	nfs4_state_shutdown_net(net);
 	if (nn->lockd_up) {
 		lockd_down(net);
-		nn->lockd_up = 0;
+		nn->lockd_up = false;
 	}
 	nn->nfsd_net_up = false;
 	nfsd_shutdown_generic();
--
2.7.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/3] nfsd: use true,false for bool variable
  2019-12-25  3:19 [PATCH 0/3] nfsd: use true,false for bool variable zhengbin
                   ` (2 preceding siblings ...)
  2019-12-25  3:19 ` [PATCH 3/3] nfsd: use true,false for bool variable in nfssvc.c zhengbin
@ 2020-01-03 16:23 ` J. Bruce Fields
  3 siblings, 0 replies; 5+ messages in thread
From: J. Bruce Fields @ 2020-01-03 16:23 UTC (permalink / raw)
  To: zhengbin; +Cc: chuck.lever, linux-nfs

Thanks, applying for 5.6.--b.

On Wed, Dec 25, 2019 at 11:19:33AM +0800, zhengbin wrote:
> zhengbin (3):
>   nfsd: use true,false for bool variable in vfs.c
>   nfsd: use true,false for bool variable in nfs4proc.c
>   nfsd: use true,false for bool variable in nfssvc.c
> 
>  fs/nfsd/nfs4proc.c | 4 ++--
>  fs/nfsd/nfssvc.c   | 6 +++---
>  fs/nfsd/vfs.c      | 6 +++---
>  3 files changed, 8 insertions(+), 8 deletions(-)
> 
> --
> 2.7.4

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-01-03 16:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-25  3:19 [PATCH 0/3] nfsd: use true,false for bool variable zhengbin
2019-12-25  3:19 ` [PATCH 1/3] nfsd: use true,false for bool variable in vfs.c zhengbin
2019-12-25  3:19 ` [PATCH 2/3] nfsd: use true,false for bool variable in nfs4proc.c zhengbin
2019-12-25  3:19 ` [PATCH 3/3] nfsd: use true,false for bool variable in nfssvc.c zhengbin
2020-01-03 16:23 ` [PATCH 0/3] nfsd: use true,false for bool variable J. Bruce Fields

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).