Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1579946pxk; Thu, 10 Sep 2020 21:00:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8RMx17kV6oNj8PMdqnmYqrXn+8zhDuqknX7cs0OQx3TbKV8B/znssrLRDHNjf7sBfTyct X-Received: by 2002:a17:906:1186:: with SMTP id n6mr155596eja.331.1599796817783; Thu, 10 Sep 2020 21:00:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599796817; cv=none; d=google.com; s=arc-20160816; b=JECBTOSky9ibW2A/fi+uIeTqlXk7WIQJyUTfc12ERUW/0TdhYOrnn9q69aAGcnXrMI LUcgKLdRgxGGQqtjX5q8eysGS7hbpfIAeseRySPcW54HHWRmyQvRheMbxkhtBaULysN8 EqcKvWIyQdujfwtukV/A8U6aJyHIohCXeDj6YQJu4y13vUsp2LOP306DkypFUUbla2JT HKmKCJvWOnlaODnzlYQ4lQomWEMzQMccnokmwPBDcF720F737ShbvQIGGMaQJ33z8yZR wzzbEjEfsJ32ETC/meW1eMeR4nwUtxl9G/jgjzXDFBsc6AjsR/mT7RZCML/rgngW5CSE yZMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=Sy8kFwFE5okPe1ZyLZ5bnXKrHCcUPpRggyog/Gadjjg=; b=MwdtwCTmb9gcbxrbuP4hZTKds0STSHUmbyie+J14gRAx2F6UIDaYyRSwZ3EgZ4a1Js XK+LorPcsVsBJmmDAj2D8qT9RPeq3OADZ9JAZxtuSwsxM/xmdKrUOhNUAYRFfkeUVIwZ dn+E3xvHZPRpSckacxJxf6tsVt58FMmN0uvh14veJd0Jk0MbIkW/3htlD+jPVrLILXMd roCU3GHLHCBM1cLtUx4XNlRq7aXAFCAZSmpdchcOSZCjkqHory9NxsFDkdahV63XCndG J5rUAbiLBkIsZSQ4JxRhym4IpyvSuGo+sjDtTcAhxyALz1MKc9Fs0Ogvb+cDoaLTMp9X OqHA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k13si489898ejr.21.2020.09.10.20.59.55; Thu, 10 Sep 2020 21:00:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725814AbgIKD7E (ORCPT + 99 others); Thu, 10 Sep 2020 23:59:04 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:59462 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725648AbgIKD64 (ORCPT ); Thu, 10 Sep 2020 23:58:56 -0400 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 581677D1528170FD2269; Fri, 11 Sep 2020 11:58:54 +0800 (CST) Received: from huawei.com (10.90.53.225) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.487.0; Fri, 11 Sep 2020 11:58:46 +0800 From: Zheng Bin To: , , , CC: , Subject: [PATCH -next 5/5] cifs: fix comparison to bool warning in smb2ops.c Date: Fri, 11 Sep 2020 12:05:39 +0800 Message-ID: <20200911040539.113307-6-zhengbin13@huawei.com> X-Mailer: git-send-email 2.26.0.106.g9fadedd In-Reply-To: <20200911040539.113307-1-zhengbin13@huawei.com> References: <20200911040539.113307-1-zhengbin13@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.90.53.225] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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