linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next 0/5] cifs: fix comparison to bool warning
@ 2020-09-11  4:05 Zheng Bin
  2020-09-11  4:05 ` [PATCH -next 1/5] cifs: fix comparison to bool warning in cifsacl.c Zheng Bin
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Zheng Bin @ 2020-09-11  4:05 UTC (permalink / raw)
  To: sfrench, linux-cifs, samba-technical, linux-kernel; +Cc: yi.zhang, zhengbin13

Zheng Bin (5):
  cifs: fix comparison to bool warning in cifsacl.c
  cifs: fix comparison to bool warning in file.c
  cifs: fix comparison to bool warning in smb2misc.c
  cifs: fix comparison to bool warning in connect.c
  cifs: fix comparison to bool warning in smb2ops.c

 fs/cifs/cifsacl.c  |  2 +-
 fs/cifs/connect.c  |  6 +++---
 fs/cifs/file.c     |  2 +-
 fs/cifs/smb2misc.c |  2 +-
 fs/cifs/smb2ops.c  | 10 +++++-----
 5 files changed, 11 insertions(+), 11 deletions(-)

--
2.26.0.106.g9fadedd


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

* [PATCH -next 1/5] cifs: fix comparison to bool warning in cifsacl.c
  2020-09-11  4:05 [PATCH -next 0/5] cifs: fix comparison to bool warning Zheng Bin
@ 2020-09-11  4:05 ` Zheng Bin
  2020-09-11  4:05 ` [PATCH -next 2/5] cifs: fix comparison to bool warning in file.c Zheng Bin
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Zheng Bin @ 2020-09-11  4:05 UTC (permalink / raw)
  To: sfrench, linux-cifs, samba-technical, linux-kernel; +Cc: yi.zhang, zhengbin13

Fixes coccicheck warning:

fs/cifs/cifsacl.c:371:6-49: WARNING: Comparison to bool

Signed-off-by: Zheng Bin <zhengbin13@huawei.com>
---
 fs/cifs/cifsacl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/cifs/cifsacl.c b/fs/cifs/cifsacl.c
index fcff14ef1c70..9447ff1a5b6a 100644
--- a/fs/cifs/cifsacl.c
+++ b/fs/cifs/cifsacl.c
@@ -368,7 +368,7 @@ sid_to_id(struct cifs_sb_info *cifs_sb, struct cifs_sid *psid,
 		else
 			is_group = false;

-		if (is_well_known_sid(psid, &unix_id, is_group) == false)
+		if (!is_well_known_sid(psid, &unix_id, is_group))
 			goto try_upcall_to_get_id;

 		if (is_group) {
--
2.26.0.106.g9fadedd


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

* [PATCH -next 2/5] cifs: fix comparison to bool warning in file.c
  2020-09-11  4:05 [PATCH -next 0/5] cifs: fix comparison to bool warning Zheng Bin
  2020-09-11  4:05 ` [PATCH -next 1/5] cifs: fix comparison to bool warning in cifsacl.c Zheng Bin
@ 2020-09-11  4:05 ` Zheng Bin
  2020-09-11  4:05 ` [PATCH -next 3/5] cifs: fix comparison to bool warning in smb2misc.c Zheng Bin
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Zheng Bin @ 2020-09-11  4:05 UTC (permalink / raw)
  To: sfrench, linux-cifs, samba-technical, linux-kernel; +Cc: yi.zhang, zhengbin13

Fixes coccicheck warning:

fs/cifs/file.c:780:22-38: WARNING: Comparison to bool

Signed-off-by: Zheng Bin <zhengbin13@huawei.com>
---
 fs/cifs/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index be46fab4c96d..bad749f606d5 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -777,7 +777,7 @@ cifs_reopen_file(struct cifsFileInfo *cfile, bool can_flush)
 	 * not dirty locally we could do this.
 	 */
 	rc = server->ops->open(xid, &oparms, &oplock, NULL);
-	if (rc == -ENOENT && oparms.reconnect == false) {
+	if (rc == -ENOENT && !oparms.reconnect) {
 		/* durable handle timeout is expired - open the file again */
 		rc = server->ops->open(xid, &oparms, &oplock, NULL);
 		/* indicate that we need to relock the file */
--
2.26.0.106.g9fadedd


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

* [PATCH -next 3/5] cifs: fix comparison to bool warning in smb2misc.c
  2020-09-11  4:05 [PATCH -next 0/5] cifs: fix comparison to bool warning Zheng Bin
  2020-09-11  4:05 ` [PATCH -next 1/5] cifs: fix comparison to bool warning in cifsacl.c Zheng Bin
  2020-09-11  4:05 ` [PATCH -next 2/5] cifs: fix comparison to bool warning in file.c Zheng Bin
@ 2020-09-11  4:05 ` Zheng Bin
  2020-09-11  4:05 ` [PATCH -next 4/5] cifs: fix comparison to bool warning in connect.c Zheng Bin
  2020-09-11  4:05 ` [PATCH -next 5/5] cifs: fix comparison to bool warning in smb2ops.c Zheng Bin
  4 siblings, 0 replies; 6+ messages in thread
From: Zheng Bin @ 2020-09-11  4:05 UTC (permalink / raw)
  To: sfrench, linux-cifs, samba-technical, linux-kernel; +Cc: yi.zhang, zhengbin13

Fixes coccicheck warning:

fs/cifs/smb2misc.c:416:5-51: WARNING: Comparison to bool

Signed-off-by: Zheng Bin <zhengbin13@huawei.com>
---
 fs/cifs/smb2misc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/cifs/smb2misc.c b/fs/cifs/smb2misc.c
index d88e2683626e..0864cfa87834 100644
--- a/fs/cifs/smb2misc.c
+++ b/fs/cifs/smb2misc.c
@@ -413,7 +413,7 @@ smb2_calc_size(void *buf, struct TCP_Server_Info *srvr)
 	 */
 	len += le16_to_cpu(pdu->StructureSize2);

-	if (has_smb2_data_area[le16_to_cpu(shdr->Command)] == false)
+	if (!has_smb2_data_area[le16_to_cpu(shdr->Command)])
 		goto calc_size_exit;

 	smb2_get_data_area_len(&offset, &data_length, shdr);
--
2.26.0.106.g9fadedd


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

* [PATCH -next 4/5] cifs: fix comparison to bool warning in connect.c
  2020-09-11  4:05 [PATCH -next 0/5] cifs: fix comparison to bool warning Zheng Bin
                   ` (2 preceding siblings ...)
  2020-09-11  4:05 ` [PATCH -next 3/5] cifs: fix comparison to bool warning in smb2misc.c Zheng Bin
@ 2020-09-11  4:05 ` Zheng Bin
  2020-09-11  4:05 ` [PATCH -next 5/5] cifs: fix comparison to bool warning in smb2ops.c Zheng Bin
  4 siblings, 0 replies; 6+ messages in thread
From: Zheng Bin @ 2020-09-11  4:05 UTC (permalink / raw)
  To: sfrench, linux-cifs, samba-technical, linux-kernel; +Cc: yi.zhang, zhengbin13

Fixes coccicheck warning:

fs/cifs/connect.c:2478:5-16: WARNING: Comparison to bool
fs/cifs/connect.c:3560:10-35: WARNING: Comparison to bool
fs/cifs/connect.c:4297:6-21: WARNING: Comparison to bool

Signed-off-by: Zheng Bin <zhengbin13@huawei.com>
---
 fs/cifs/connect.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index a5731dd6e656..4d2651b9f019 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -2475,7 +2475,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
 	else if (override_gid == 1)
 		pr_notice("ignoring forcegid mount option specified with no gid= option\n");

-	if (got_version == false)
+	if (!got_version)
 		pr_warn_once("No dialect specified on mount. Default has changed to a more secure dialect, SMB2.1 or later (e.g. SMB3.1.1), from CIFS (SMB1). To use the less secure SMB1 dialect to access old servers which do not support SMB3.1.1 (or even SMB3 or SMB2.1) specify vers=1.0 on mount.\n");

 	kfree(mountdata_copy);
@@ -3557,7 +3557,7 @@ cifs_get_tcon(struct cifs_ses *ses, struct smb_vol *volume_info)
 		}
 	} else if ((tcon->capabilities & SMB2_SHARE_CAP_CONTINUOUS_AVAILABILITY)
 	     && (ses->server->capabilities & SMB2_GLOBAL_CAP_PERSISTENT_HANDLES)
-	     && (volume_info->nopersistent == false)) {
+	     && !volume_info->nopersistent) {
 		cifs_dbg(FYI, "enabling persistent handles\n");
 		tcon->use_persistent = true;
 	} else if (volume_info->resilient) {
@@ -4294,7 +4294,7 @@ static int mount_get_conns(struct smb_vol *vol, struct cifs_sb_info *cifs_sb,

 	*nses = ses;

-	if ((vol->persistent == true) && (!(ses->server->capabilities &
+	if (vol->persistent && (!(ses->server->capabilities &
 					    SMB2_GLOBAL_CAP_PERSISTENT_HANDLES))) {
 		cifs_server_dbg(VFS, "persistent handles not supported by server\n");
 		return -EOPNOTSUPP;
--
2.26.0.106.g9fadedd


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

* [PATCH -next 5/5] cifs: fix comparison to bool warning in smb2ops.c
  2020-09-11  4:05 [PATCH -next 0/5] cifs: fix comparison to bool warning Zheng Bin
                   ` (3 preceding siblings ...)
  2020-09-11  4:05 ` [PATCH -next 4/5] cifs: fix comparison to bool warning in connect.c Zheng Bin
@ 2020-09-11  4:05 ` Zheng Bin
  4 siblings, 0 replies; 6+ messages in thread
From: Zheng Bin @ 2020-09-11  4:05 UTC (permalink / raw)
  To: sfrench, linux-cifs, samba-technical, linux-kernel; +Cc: yi.zhang, zhengbin13

Fixes coccicheck warning:

fs/cifs/smb2ops.c:3199:6-15: WARNING: Comparison to bool
fs/cifs/smb2ops.c:3223:5-14: WARNING: Comparison to bool
fs/cifs/smb2ops.c:3301:6-15: WARNING: Comparison to bool
fs/cifs/smb2ops.c:3311:6-15: WARNING: Comparison to bool
fs/cifs/smb2ops.c:3341:6-15: WARNING: Comparison to bool

Signed-off-by: Zheng Bin <zhengbin13@huawei.com>
---
 fs/cifs/smb2ops.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
index 32f90dc82c84..213a0e3d9f76 100644
--- a/fs/cifs/smb2ops.c
+++ b/fs/cifs/smb2ops.c
@@ -3196,7 +3196,7 @@ static long smb3_zero_range(struct file *file, struct cifs_tcon *tcon,

 	/* if file not oplocked can't be sure whether asking to extend size */
 	if (!CIFS_CACHE_READ(cifsi))
-		if (keep_size == false) {
+		if (!keep_size) {
 			rc = -EOPNOTSUPP;
 			trace_smb3_zero_err(xid, cfile->fid.persistent_fid,
 				tcon->tid, ses->Suid, offset, len, rc);
@@ -3220,7 +3220,7 @@ static long smb3_zero_range(struct file *file, struct cifs_tcon *tcon,
 	/*
 	 * do we also need to change the size of the file?
 	 */
-	if (keep_size == false && i_size_read(inode) < offset + len) {
+	if (!keep_size && i_size_read(inode) < offset + len) {
 		eof = cpu_to_le64(offset + len);
 		rc = SMB2_set_eof(xid, tcon, cfile->fid.persistent_fid,
 				  cfile->fid.volatile_fid, cfile->pid, &eof);
@@ -3298,7 +3298,7 @@ static long smb3_simple_falloc(struct file *file, struct cifs_tcon *tcon,
 				tcon->ses->Suid, off, len);
 	/* if file not oplocked can't be sure whether asking to extend size */
 	if (!CIFS_CACHE_READ(cifsi))
-		if (keep_size == false) {
+		if (!keep_size) {
 			trace_smb3_falloc_err(xid, cfile->fid.persistent_fid,
 				tcon->tid, tcon->ses->Suid, off, len, rc);
 			free_xid(xid);
@@ -3308,7 +3308,7 @@ static long smb3_simple_falloc(struct file *file, struct cifs_tcon *tcon,
 	/*
 	 * Extending the file
 	 */
-	if ((keep_size == false) && i_size_read(inode) < off + len) {
+	if (!keep_size && i_size_read(inode) < off + len) {
 		rc = inode_newsize_ok(inode, off + len);
 		if (rc)
 			goto out;
@@ -3338,7 +3338,7 @@ static long smb3_simple_falloc(struct file *file, struct cifs_tcon *tcon,
 		goto out;
 	}

-	if ((keep_size == true) || (i_size_read(inode) >= off + len)) {
+	if (keep_size || (i_size_read(inode) >= off + len)) {
 		/*
 		 * Check if falloc starts within first few pages of file
 		 * and ends within a few pages of the end of file to
--
2.26.0.106.g9fadedd


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

end of thread, other threads:[~2020-09-11  3:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-11  4:05 [PATCH -next 0/5] cifs: fix comparison to bool warning Zheng Bin
2020-09-11  4:05 ` [PATCH -next 1/5] cifs: fix comparison to bool warning in cifsacl.c Zheng Bin
2020-09-11  4:05 ` [PATCH -next 2/5] cifs: fix comparison to bool warning in file.c Zheng Bin
2020-09-11  4:05 ` [PATCH -next 3/5] cifs: fix comparison to bool warning in smb2misc.c Zheng Bin
2020-09-11  4:05 ` [PATCH -next 4/5] cifs: fix comparison to bool warning in connect.c Zheng Bin
2020-09-11  4:05 ` [PATCH -next 5/5] cifs: fix comparison to bool warning in smb2ops.c Zheng Bin

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