]> git.baikalelectronics.ru Git - kernel.git/commitdiff
nfsd: use true,false for bool variable in vfs.c
authorzhengbin <zhengbin13@huawei.com>
Wed, 25 Dec 2019 03:19:34 +0000 (11:19 +0800)
committerJ. Bruce Fields <bfields@redhat.com>
Fri, 3 Jan 2020 16:21:12 +0000 (11:21 -0500)
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>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/vfs.c

index fe8c5d0e8c5f88d1fbe84d7ba7d6cd5b4e2efeab..3aeffb26fca5d31dced3d7907b8fa9c8385c79f4 100644 (file)
@@ -1396,7 +1396,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 */
@@ -1405,7 +1405,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 */
@@ -1422,7 +1422,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);