From nobody Tue Feb 10 18:36:11 2026 Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CAD2F2F12DA for ; Mon, 9 Feb 2026 17:54:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770659687; cv=none; b=pMGT49PgDvAsKFHBa4QnmxZCUmtdf5tENN+hdM09/eTmuBhGvC/4NM3mpM1HyROVKLQdhi/Qmx6WWQ39NknWnjfncoOZCrJFybRGfklrgc0kOB64pLp9eY0zC7tGkvSxvYgeMv8R5Jykcb90F/l0Vf2mDRYEp86pbz6gZeX+XEE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770659687; c=relaxed/simple; bh=uW5tKQ+f2Xf6dN5fI3wopsswMwQI5cGYat6wCHBRekw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rtSUVKZOP8lCmoIQN4eh6uBkiDTDqjdi6MtzuiA4QaCryESRkrGfS5uUY6cFvYIOUtBIhyN6RmnpDfSR/GUvj9Js3YXSDnpFJRxu+L5fWc/Ln2hXfFbX1tzp2JwQlB2iM/tZft7ylgXbG/qB4qVh1CNQtQXauL0581j8CvSQ9HU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=JEqcyMU1; arc=none smtp.client-ip=209.85.210.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="JEqcyMU1" Received: by mail-pf1-f178.google.com with SMTP id d2e1a72fcca58-81ecbdfdcebso2189645b3a.1 for ; Mon, 09 Feb 2026 09:54:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770659687; x=1771264487; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=x579W78puk2J7viePwNvGcMeO83v1ceQH2g54H75Lgk=; b=JEqcyMU1qS0VQyU4SmSQqi5+ABMfKqys0KaOrHtLMejzUqU6p2QDQq0bCI8J0Kwo81 466WZIieurAK7CmZ7gCY18yR8iq90kEA8/nYYdpsNINO/k1kSYnY1wl9jRWbDuX2uVsB TSDy/Nfi7oT5pMK3usStGW/pXDnvH8Cobhm1Il+m7zytqX+fwDQ5Koyrl1NClRhNDEht PjXE5zu/FDDBP+RUASh2CuJPeuRHaCN99aNaA1L9zDAXPmsUWOdzyVUdF+NCaiQXt+X9 WH6rMuQuVokmmzgH77hSZur13Byc5WeLl8p3tImqbZE7zrJ4VGme/UfcaYlMu0tTxU23 EFxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770659687; x=1771264487; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=x579W78puk2J7viePwNvGcMeO83v1ceQH2g54H75Lgk=; b=nQP+P1jj/zalmZipCg9ODKOmo8S+ZjFEQR+eZY7Fbmm3rZWdAIcKs7ULdONPzAWniL Orabt6A8CpVqlP/v0ZBU4NsvaIeft1O8GF4ItyLpWZIZsQivSINmWKgzyTcEY4hRkq/F BK3eqSfJ2nvs5MyGQAQ2swi9l0Z0Q3RKQY+txCJHDoh1UObZl+eXAWedSyJ+4AgwMeu/ hZh3VwV7Wt3jPFTV9sZT06Nkaq7OZYl7o463U6bEfB/knykSphZ2pRAOoMZgkTQtNO0E 1OKJLpMmKY3sl9TokEYHhQKxtrBiAhtO1nxl97anZZYWh9VzJGoMxCXc4RaNCRr6FhO/ ZxMQ== X-Forwarded-Encrypted: i=1; AJvYcCUnUB1smV+oIacJ4JKAWLCu01u996NGp0MmDCOh+O4qBivv9JUXG5xjaDoI1s4AaddlJmIOws+70EQQiOI=@vger.kernel.org X-Gm-Message-State: AOJu0YyKfjrVPzVJcdFMzJnKqOfWBv38GzHl96H4x4u0CQzrA2NugPbh WH52N+s42ctRzcUkfNeAu55x3IeqgpNgjLf7ndkEaFTV5TBGaDr8nS37 X-Gm-Gg: AZuq6aIHjqTyk+9y73py/U2HZLa6UyyCtKBGV4YM5G0avYzsVtPXgED2xXLxFEd6FiI b4o2yXIljYlQL9rW1uNADJ9lZj3srCh65Hsto40XvhRS6FHXragi2MJKbJPWW7WRORihdbsMyhl 55f7awhqaixac8Qo6OKoN+SjWgLboMzHZInDtCWu0HJI9igKIss+BJW/9Sj/TDTavSWTSCA+jZS IDHXiAkOT7+vh/upU8pzzcyTgpw56YUvEpIT10WcbLd+r4+doOY/6YtQYFY8GRVQiQcq+ivT1Kp 5IrP6hVDuL+A1Env7m1cBS6qdhZK72Mk1nOpzWbNE7SQTMJxPUR/S2kDcB4yYLXYdVQaFPvM1uC cUfMen1ggO47HmNno4tk4umORCHsAa6fAA/rauJcjziDgf6nDvbkES+4lOhwHEI708hAaNMFONN 3feHhighTnPbFD X-Received: by 2002:a05:6a00:12de:b0:823:1580:790e with SMTP id d2e1a72fcca58-824417b006dmr10560937b3a.56.1770659686885; Mon, 09 Feb 2026 09:54:46 -0800 (PST) Received: from archlinux ([103.208.68.249]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8244166f3e2sm11232882b3a.10.2026.02.09.09.54.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Feb 2026 09:54:46 -0800 (PST) From: Adarsh Das To: sfrench@samba.org, linkinjeon@kernel.org Cc: pc@manguebit.org, ronniesahlberg@gmail.com, sprasad@microsoft.com, tom@talpey.com, bharathsm@microsoft.com, senozhatsky@chromium.org, linux-cifs@vger.kernel.org, linux-kernel@vger.kernel.org, Adarsh Das Subject: [PATCH 1/2] smb: remove redundant == true comparisons Date: Mon, 9 Feb 2026 23:24:20 +0530 Message-ID: <20260209175421.66469-2-adarshdas950@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260209175421.66469-1-adarshdas950@gmail.com> References: <20260209175421.66469-1-adarshdas950@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Remove "=3D=3D true" comparisons with boolean variables. Should improve readability. Signed-off-by: Adarsh Das --- fs/smb/client/connect.c | 4 ++-- fs/smb/client/misc.c | 2 +- fs/smb/client/smb2ops.c | 4 ++-- fs/smb/server/server.c | 2 +- fs/smb/server/smb2pdu.c | 12 ++++++------ fs/smb/server/vfs.c | 8 ++++---- fs/smb/server/vfs_cache.c | 2 +- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/fs/smb/client/connect.c b/fs/smb/client/connect.c index ce620503e9f7..75137359757d 100644 --- a/fs/smb/client/connect.c +++ b/fs/smb/client/connect.c @@ -962,7 +962,7 @@ dequeue_mid(struct TCP_Server_Info *server, struct mid_= q_entry *mid, bool malfor * Trying to handle/dequeue a mid after the send_recv() * function has finished processing it is a bug. */ - if (mid->deleted_from_q =3D=3D true) { + if (mid->deleted_from_q) { spin_unlock(&server->mid_queue_lock); pr_warn_once("trying to dequeue a deleted mid\n"); } else { @@ -3675,7 +3675,7 @@ int cifs_mount_get_session(struct cifs_mount_ctx *mnt= _ctx) goto out; } =20 - if ((ctx->persistent =3D=3D true) && (!(ses->server->capabilities & + if (ctx->persistent && (!(ses->server->capabilities & SMB2_GLOBAL_CAP_PERSISTENT_HANDLES))) { cifs_server_dbg(VFS, "persistent handles not supported by server\n"); rc =3D -EOPNOTSUPP; diff --git a/fs/smb/client/misc.c b/fs/smb/client/misc.c index 9529fa385938..bc5b74bdcb4e 100644 --- a/fs/smb/client/misc.c +++ b/fs/smb/client/misc.c @@ -122,7 +122,7 @@ tcon_info_alloc(bool dir_leases_enabled, enum smb3_tcon= _ref_trace trace) if (!ret_buf) return NULL; =20 - if (dir_leases_enabled =3D=3D true) { + if (dir_leases_enabled) { ret_buf->cfids =3D init_cached_dirs(); if (!ret_buf->cfids) { kfree(ret_buf); diff --git a/fs/smb/client/smb2ops.c b/fs/smb/client/smb2ops.c index c1aaf77e187b..edf5afb2ddd2 100644 --- a/fs/smb/client/smb2ops.c +++ b/fs/smb/client/smb2ops.c @@ -3681,7 +3681,7 @@ static long smb3_simple_falloc(struct file *file, str= uct cifs_tcon *tcon, goto out; } =20 - if (keep_size =3D=3D true) { + if (keep_size) { /* * We can not preallocate pages beyond the end of the file * in SMB2 @@ -3699,7 +3699,7 @@ static long smb3_simple_falloc(struct file *file, str= uct cifs_tcon *tcon, } } =20 - if ((keep_size =3D=3D true) || (i_size_read(inode) >=3D off + len)) { + if (keep_size || (i_size_read(inode) >=3D off + len)) { /* * At this point, we are trying to fallocate an internal * regions of a sparse file. Since smb2 does not have a diff --git a/fs/smb/server/server.c b/fs/smb/server/server.c index 554ae90df906..78e68a7a618a 100644 --- a/fs/smb/server/server.c +++ b/fs/smb/server/server.c @@ -235,7 +235,7 @@ static void __handle_ksmbd_work(struct ksmbd_work *work, (work->sess->sign || smb3_11_final_sess_setup_resp(work) || conn->ops->is_sign_req(work, command))) conn->ops->set_sign_rsp(work); - } while (is_chained =3D=3D true); + } while (is_chained); =20 send: if (work->tcon) diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c index 2fcd0d4d1fb0..de40ef7ac26a 100644 --- a/fs/smb/server/smb2pdu.c +++ b/fs/smb/server/smb2pdu.c @@ -2601,7 +2601,7 @@ static int smb2_creat(struct ksmbd_work *work, return -EBADF; =20 ksmbd_debug(SMB, "file does not exist, so creating\n"); - if (is_dir =3D=3D true) { + if (is_dir) { ksmbd_debug(SMB, "creating directory\n"); =20 mode =3D share_config_directory_mode(share, posix_mode); @@ -2987,7 +2987,7 @@ int smb2_open(struct ksmbd_work *work) goto err_out2; } =20 - if (dh_info.reconnected =3D=3D true) { + if (dh_info.reconnected) { rc =3D smb2_check_durable_oplock(conn, share, dh_info.fp, lc, name); if (rc) { ksmbd_put_durable_fd(dh_info.fp); @@ -6222,7 +6222,7 @@ static int set_file_allocation_info(struct ksmbd_work= *work, if (!(fp->daccess & FILE_WRITE_DATA_LE)) return -EACCES; =20 - if (ksmbd_stream_fd(fp) =3D=3D true) + if (ksmbd_stream_fd(fp)) return 0; =20 rc =3D vfs_getattr(&fp->filp->f_path, &stat, STATX_BASIC_STATS, @@ -6779,7 +6779,7 @@ int smb2_read(struct ksmbd_work *work) } } =20 - if (is_rdma_channel =3D=3D true) { + if (is_rdma_channel) { unsigned int ch_offset =3D le16_to_cpu(req->ReadChannelInfoOffset); =20 if (ch_offset < offsetof(struct smb2_read_req, Buffer)) { @@ -6849,7 +6849,7 @@ int smb2_read(struct ksmbd_work *work) ksmbd_debug(SMB, "nbytes %zu, offset %lld mincount %zu\n", nbytes, offset, mincount); =20 - if (is_rdma_channel =3D=3D true) { + if (is_rdma_channel) { /* write data to the client using rdma channel */ remain_bytes =3D smb2_read_rdma_channel(work, req, aux_payload_buf, @@ -7043,7 +7043,7 @@ int smb2_write(struct ksmbd_work *work) length =3D le32_to_cpu(req->RemainingBytes); } =20 - if (is_rdma_channel =3D=3D true) { + if (is_rdma_channel) { unsigned int ch_offset =3D le16_to_cpu(req->WriteChannelInfoOffset); =20 if (req->Length !=3D 0 || req->DataOffset !=3D 0 || diff --git a/fs/smb/server/vfs.c b/fs/smb/server/vfs.c index b8e648b8300f..6e6ad5eda9ea 100644 --- a/fs/smb/server/vfs.c +++ b/fs/smb/server/vfs.c @@ -877,7 +877,7 @@ int ksmbd_vfs_setxattr(struct mnt_idmap *idmap, { int err; =20 - if (get_write =3D=3D true) { + if (get_write) { err =3D mnt_want_write(path->mnt); if (err) return err; @@ -891,7 +891,7 @@ int ksmbd_vfs_setxattr(struct mnt_idmap *idmap, flags); if (err) ksmbd_debug(VFS, "setxattr failed, err %d\n", err); - if (get_write =3D=3D true) + if (get_write) mnt_drop_write(path->mnt); return err; } @@ -1001,7 +1001,7 @@ int ksmbd_vfs_remove_xattr(struct mnt_idmap *idmap, { int err; =20 - if (get_write =3D=3D true) { + if (get_write) { err =3D mnt_want_write(path->mnt); if (err) return err; @@ -1009,7 +1009,7 @@ int ksmbd_vfs_remove_xattr(struct mnt_idmap *idmap, =20 err =3D vfs_removexattr(idmap, path->dentry, attr_name); =20 - if (get_write =3D=3D true) + if (get_write) mnt_drop_write(path->mnt); =20 return err; diff --git a/fs/smb/server/vfs_cache.c b/fs/smb/server/vfs_cache.c index 6ef116585af6..ea9c237b2bca 100644 --- a/fs/smb/server/vfs_cache.c +++ b/fs/smb/server/vfs_cache.c @@ -863,7 +863,7 @@ void ksmbd_launch_ksmbd_durable_scavenger(void) return; =20 mutex_lock(&durable_scavenger_lock); - if (durable_scavenger_running =3D=3D true) { + if (durable_scavenger_running) { mutex_unlock(&durable_scavenger_lock); return; } --=20 2.53.0 From nobody Tue Feb 10 18:36:11 2026 Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 55BE12F12DA for ; Mon, 9 Feb 2026 17:54:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770659696; cv=none; b=ds8znXxxAv6rm6EiALiw6nVEAIdtN8Z1YDj/4U0U4bBZG/lZgF0oyrj7ejPFCbK2LtP/nr3b3v7I79Eavk34PWT51trf2Hnwr9ioljov7WHs404UwS12ViwqXQCIqAm8hbyyMyhjh/1Bs6gcT0n7EGhkbGTtQ6Fiyf3msBrl0n0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770659696; c=relaxed/simple; bh=Xcsa/vUrM59zSkR9BfiDp8riePk0QKU/ZKRnCDqFn20=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JR6xKkQsIU9how5oFIG5DcGfhbMHDsX19RrrjDaLfA+yAb2PHme856/svJloQ6qfx4dGcJknt+4BxK7Gbvfxl6BhT7DvPUG+inHc4TpvoODs4SZIo+2u+bBkiFnK6RhqFcm6vaQK18JTCnShUH+Tnx1FXTLb/q0m8lFqleOQjj0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=SrhqRWN4; arc=none smtp.client-ip=209.85.210.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SrhqRWN4" Received: by mail-pf1-f169.google.com with SMTP id d2e1a72fcca58-8230d228372so2767808b3a.1 for ; Mon, 09 Feb 2026 09:54:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770659696; x=1771264496; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=DKnD6Utj1BA/r+uw0GOlDUCqNKypNjUDF6q0/a2S7o4=; b=SrhqRWN4A+0ytRg2UqNrq88fbWbKPAFOoifvKkouDzn+hqnHC6ftFdUwOJctF6du8V HnnTKmZkKAxcni8aVcSRkGYFlBdy3F+hNA2i3VcwJbs+Fe+BDpeNqK5AvCvS+pqGuGGU oqNIQ3R3bKqQgQBgDwV8WIEVEudtUnH6iT+O8uoW2MaiHtDq3Sq21N2jL2zDYkSTEWO9 BppKPD9jbNbTa0epuxJulYL4s/l49ReTiEpf+9x9Fxt7QS5k3sC6mLQc1zMbPuhtVGnK wpGiadGWyXPPWKsbGYBbh30DHMd2qg/wO4+OUkl9WKPrsCRAQy35Ch8bl4ZiEDaqtmt+ OV9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770659696; x=1771264496; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=DKnD6Utj1BA/r+uw0GOlDUCqNKypNjUDF6q0/a2S7o4=; b=MDYQTVfradtWZNLZNQydeguxYsXnkzPrNwOE7ZXTKeiGT3pmVBCFuJWdtTgnEbmG9X WrE8UUCDFgvsbw+dEullwfgBWecgl2TmInj7g0infz3PtZipC9V7remQ6htAgA2BCTV3 KgP+Ey9B4C55sNqnxNMaruwhlAHrZgE75Xwf37frkeM/a439BxW6QYhJboSlgCW7bsLS qYA5HOrjolu4E7XksyrLlZYeJAL2OJAzSM8/C7LaZjyH34z1zBE4gRmQGc9ba9by7vbW hXF/fPwwifFQpfLdwRJxnjtSh7v9/YmBxxadFJD+TlSMNd2cmdZTopkuEyxSOHto5mm7 W7xQ== X-Forwarded-Encrypted: i=1; AJvYcCWqLlf5AHq4WtTwPl7UXIJRvMZZhbTiakTe3Kl1Rqp1FDxHBEQqxoyFZ6uI4pp8aKObz4WUx4dDYLpMSLk=@vger.kernel.org X-Gm-Message-State: AOJu0YzsHXZ/TWS69j/L3OOVWMP+q3BvsrFinTfIt3qBNCRE4ibMIRBt 9MuJqcWo3J7Egsy7A/WQZ0os0p4ZoVoEfIFl54+9FeKbBReH7AVl8TqD X-Gm-Gg: AZuq6aKNx8O0WPvaBW6KsaJLOSuB5250D7qjfzwjQlZEn2/X+XHqr4OZkk8Sl9DkuWw IMexCgB8SfkAyIWlHodQTVpnbnHfzgz9MpsoWvDkm9vHyDKbHYwu/cj/tjG+Gr+0KouSEAymXeA NGYLItEQm6R4ozhk+VUNQc2gXd/UzZiAyUZaONxw8IKLkAXXUMvCtJD4urn+Y4MYMfIdhElHhJC vL6iB9UdfdWQr2v+XKE2tPxT4YRHROTBTUdBgZtsfA77a8juN495htS7E2vmexZ+HgCM0Jq8s51 /2Dr9DYeF/pjiEVIVl/g6No5vpVuqqHGUf/+D27Tq39zkkIYF5Idn67sa/hcOG6gIlTir+ZgZ+U 0yARGN+9xoyEe8arQQynLYXZI+qxu/hZunY/StqBWw2PkzFXtn5lW8X0sIc2SN69kkLqBNNe1YC MFqc7cSbihN91iQ+qIOKenVD4= X-Received: by 2002:a05:6a00:2442:b0:81f:9a5b:e8fc with SMTP id d2e1a72fcca58-82441762e1fmr11176826b3a.54.1770659695428; Mon, 09 Feb 2026 09:54:55 -0800 (PST) Received: from archlinux ([103.208.68.249]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8244166f3e2sm11232882b3a.10.2026.02.09.09.54.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Feb 2026 09:54:55 -0800 (PST) From: Adarsh Das To: sfrench@samba.org, linkinjeon@kernel.org Cc: pc@manguebit.org, ronniesahlberg@gmail.com, sprasad@microsoft.com, tom@talpey.com, bharathsm@microsoft.com, senozhatsky@chromium.org, linux-cifs@vger.kernel.org, linux-kernel@vger.kernel.org, Adarsh Das Subject: [PATCH 2/2] smb: remove redundant == false comparisons Date: Mon, 9 Feb 2026 23:24:21 +0530 Message-ID: <20260209175421.66469-3-adarshdas950@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260209175421.66469-1-adarshdas950@gmail.com> References: <20260209175421.66469-1-adarshdas950@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Replace "=3D=3D false" with "!" operator. This should improve readability. Signed-off-by: Adarsh Das --- fs/smb/client/cifsacl.c | 2 +- fs/smb/client/connect.c | 2 +- fs/smb/client/file.c | 5 ++--- fs/smb/client/fs_context.c | 6 +++--- fs/smb/client/smb2misc.c | 4 ++-- fs/smb/client/smb2ops.c | 8 ++++---- fs/smb/client/smb2pdu.c | 2 +- fs/smb/client/transport.c | 2 +- fs/smb/server/oplock.c | 6 +++--- fs/smb/server/smb2misc.c | 2 +- fs/smb/server/smb2pdu.c | 32 +++++++++++++++----------------- fs/smb/server/smb_common.c | 2 +- fs/smb/server/transport_rdma.c | 2 +- fs/smb/server/vfs_cache.c | 4 ++-- 14 files changed, 38 insertions(+), 41 deletions(-) diff --git a/fs/smb/client/cifsacl.c b/fs/smb/client/cifsacl.c index 7e6e473bd4a0..4771e310cac3 100644 --- a/fs/smb/client/cifsacl.c +++ b/fs/smb/client/cifsacl.c @@ -367,7 +367,7 @@ sid_to_id(struct cifs_sb_info *cifs_sb, struct smb_sid = *psid, else is_group =3D false; =20 - if (is_well_known_sid(psid, &unix_id, is_group) =3D=3D false) + if (!is_well_known_sid(psid, &unix_id, is_group)) goto try_upcall_to_get_id; =20 if (is_group) { diff --git a/fs/smb/client/connect.c b/fs/smb/client/connect.c index 75137359757d..eaf2855625a4 100644 --- a/fs/smb/client/connect.c +++ b/fs/smb/client/connect.c @@ -2801,7 +2801,7 @@ cifs_get_tcon(struct cifs_ses *ses, struct smb3_fs_co= ntext *ctx) } } else if ((tcon->capabilities & SMB2_SHARE_CAP_CONTINUOUS_AVAILABILITY) && (ses->server->capabilities & SMB2_GLOBAL_CAP_PERSISTENT_HANDLES) - && (ctx->nopersistent =3D=3D false)) { + && !ctx->nopersistent) { cifs_dbg(FYI, "enabling persistent handles\n"); tcon->use_persistent =3D true; } else if (ctx->resilient) { diff --git a/fs/smb/client/file.c b/fs/smb/client/file.c index 7ff5cc9c5c5b..bc218f34b7e8 100644 --- a/fs/smb/client/file.c +++ b/fs/smb/client/file.c @@ -1350,7 +1350,7 @@ cifs_reopen_file(struct cifsFileInfo *cfile, bool can= _flush) * not dirty locally we could do this. */ rc =3D server->ops->open(xid, &oparms, &oplock, NULL); - if (rc =3D=3D -ENOENT && oparms.reconnect =3D=3D false) { + if (rc =3D=3D -ENOENT && !oparms.reconnect) { /* durable handle timeout is expired - open the file again */ rc =3D server->ops->open(xid, &oparms, &oplock, NULL); /* indicate that we need to relock the file */ @@ -1459,8 +1459,7 @@ int cifs_close(struct inode *inode, struct file *file) cfile =3D file->private_data; file->private_data =3D NULL; dclose =3D kmalloc(sizeof(struct cifs_deferred_close), GFP_KERNEL); - if ((cfile->status_file_deleted =3D=3D false) && - (smb2_can_defer_close(inode, dclose))) { + if (!cfile->status_file_deleted && smb2_can_defer_close(inode, dclose)) { if (test_and_clear_bit(NETFS_ICTX_MODIFIED_ATTR, &cinode->netfs.flags))= { inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode)); diff --git a/fs/smb/client/fs_context.c b/fs/smb/client/fs_context.c index d4291d3a9a48..d95b4d3c8fe4 100644 --- a/fs/smb/client/fs_context.c +++ b/fs/smb/client/fs_context.c @@ -851,7 +851,7 @@ static int smb3_fs_context_validate(struct fs_context *= fc) } #endif =20 - if (ctx->got_version =3D=3D false) + if (!ctx->got_version) pr_warn_once("No dialect specified on mount. Default has changed to a mo= re secure dialect, SMB2.1 or later (e.g. SMB3.1.1), from CIFS (SMB1). To us= e the less secure SMB1 dialect to access old servers which do not support S= MB3.1.1 (or even SMB3 or SMB2.1) specify vers=3D1.0 on mount.\n"); =20 =20 @@ -977,7 +977,7 @@ static int smb3_verify_reconfigure_ctx(struct fs_contex= t *fc, } if (new_ctx->password && (!old_ctx->password || strcmp(new_ctx->password, old_ctx->password)))= { - if (need_recon =3D=3D false) { + if (!need_recon) { cifs_errorf(fc, "can not change password of active session during remount\n"); return -EINVAL; @@ -1100,7 +1100,7 @@ static int smb3_reconfigure(struct fs_context *fc) STEAL_STRING(cifs_sb, ctx, source); STEAL_STRING(cifs_sb, ctx, username); =20 - if (need_recon =3D=3D false) + if (!need_recon) STEAL_STRING_SENSITIVE(cifs_sb, ctx, password); else { if (ctx->password) { diff --git a/fs/smb/client/smb2misc.c b/fs/smb/client/smb2misc.c index f3cb62d91450..bc940034a72f 100644 --- a/fs/smb/client/smb2misc.c +++ b/fs/smb/client/smb2misc.c @@ -425,7 +425,7 @@ smb2_calc_size(void *buf) */ len +=3D le16_to_cpu(pdu->StructureSize2); =20 - if (has_smb2_data_area[le16_to_cpu(shdr->Command)] =3D=3D false) + if (!has_smb2_data_area[le16_to_cpu(shdr->Command)]) goto calc_size_exit; =20 smb2_get_data_area_len(&offset, &data_length, shdr); @@ -808,7 +808,7 @@ __smb2_handle_cancelled_cmd(struct cifs_tcon *tcon, __u= 16 cmd, __u64 mid, cancelled->cmd =3D cmd; cancelled->mid =3D mid; INIT_WORK(&cancelled->work, smb2_cancelled_close_fid); - WARN_ON(queue_work(cifsiod_wq, &cancelled->work) =3D=3D false); + WARN_ON(!queue_work(cifsiod_wq, &cancelled->work)); =20 return 0; } diff --git a/fs/smb/client/smb2ops.c b/fs/smb/client/smb2ops.c index edf5afb2ddd2..16a0e572f775 100644 --- a/fs/smb/client/smb2ops.c +++ b/fs/smb/client/smb2ops.c @@ -3403,7 +3403,7 @@ static long smb3_zero_range(struct file *file, struct= cifs_tcon *tcon, =20 /* if file not oplocked can't be sure whether asking to extend size */ rc =3D -EOPNOTSUPP; - if (keep_size =3D=3D false && !CIFS_CACHE_READ(cifsi)) + if (!keep_size && !CIFS_CACHE_READ(cifsi)) goto zero_range_exit; =20 rc =3D smb3_zero_data(file, tcon, offset, len, xid); @@ -3414,7 +3414,7 @@ static long smb3_zero_range(struct file *file, struct= cifs_tcon *tcon, * do we also need to change the size of the file? */ new_size =3D offset + len; - if (keep_size =3D=3D false && (unsigned long long)i_size_read(inode) < ne= w_size) { + if (!keep_size && (unsigned long long)i_size_read(inode) < new_size) { rc =3D SMB2_set_eof(xid, tcon, cfile->fid.persistent_fid, cfile->fid.volatile_fid, cfile->pid, new_size); if (rc >=3D 0) { @@ -3643,7 +3643,7 @@ static long smb3_simple_falloc(struct file *file, str= uct 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 =3D=3D false) { + if (!keep_size) { trace_smb3_falloc_err(xid, cfile->fid.persistent_fid, tcon->tid, tcon->ses->Suid, off, len, rc); free_xid(xid); @@ -3653,7 +3653,7 @@ static long smb3_simple_falloc(struct file *file, str= uct cifs_tcon *tcon, /* * Extending the file */ - if ((keep_size =3D=3D false) && i_size_read(inode) < off + len) { + if (!keep_size && i_size_read(inode) < off + len) { rc =3D inode_newsize_ok(inode, off + len); if (rc) goto out; diff --git a/fs/smb/client/smb2pdu.c b/fs/smb/client/smb2pdu.c index 5d57c895ca37..254409ddcc66 100644 --- a/fs/smb/client/smb2pdu.c +++ b/fs/smb/client/smb2pdu.c @@ -1636,7 +1636,7 @@ SMB2_sess_sendreceive(struct SMB2_sess_data *sess_dat= a) if (rc =3D=3D 0) sess_data->ses->expired_pwd =3D false; else if ((rc =3D=3D -EACCES) || (rc =3D=3D -EKEYEXPIRED) || (rc =3D=3D -E= KEYREVOKED)) { - if (sess_data->ses->expired_pwd =3D=3D false) + if (!sess_data->ses->expired_pwd) trace_smb3_key_expired(sess_data->server->hostname, sess_data->ses->user_name, sess_data->server->conn_id, diff --git a/fs/smb/client/transport.c b/fs/smb/client/transport.c index 3b34c3f4da2d..b9809d4110e6 100644 --- a/fs/smb/client/transport.c +++ b/fs/smb/client/transport.c @@ -762,7 +762,7 @@ int cifs_sync_mid_result(struct mid_q_entry *mid, struc= t TCP_Server_Info *server rc =3D mid->mid_rc; break; default: - if (mid->deleted_from_q =3D=3D false) { + if (!mid->deleted_from_q) { list_del_init(&mid->qhead); mid->deleted_from_q =3D true; } diff --git a/fs/smb/server/oplock.c b/fs/smb/server/oplock.c index a5967ac46604..3a0fdde9dade 100644 --- a/fs/smb/server/oplock.c +++ b/fs/smb/server/oplock.c @@ -583,7 +583,7 @@ static int oplock_break_pending(struct oplock_info *opi= nfo, int req_op_level) if (opinfo->op_state =3D=3D OPLOCK_CLOSING) return -ENOENT; else if (opinfo->level <=3D req_op_level) { - if (opinfo->is_lease =3D=3D false) + if (!opinfo->is_lease) return 1; =20 if (opinfo->o_lease->state !=3D @@ -594,7 +594,7 @@ static int oplock_break_pending(struct oplock_info *opi= nfo, int req_op_level) } =20 if (opinfo->level <=3D req_op_level) { - if (opinfo->is_lease =3D=3D false) { + if (!opinfo->is_lease) { wake_up_oplock_break(opinfo); return 1; } @@ -1816,7 +1816,7 @@ int smb2_check_durable_oplock(struct ksmbd_conn *conn, if (!opinfo) return 0; =20 - if (opinfo->is_lease =3D=3D false) { + if (!opinfo->is_lease) { if (lctx) { pr_err("create context include lease\n"); ret =3D -EBADF; diff --git a/fs/smb/server/smb2misc.c b/fs/smb/server/smb2misc.c index a1ddca21c47b..e303596c83a3 100644 --- a/fs/smb/server/smb2misc.c +++ b/fs/smb/server/smb2misc.c @@ -228,7 +228,7 @@ static int smb2_calc_size(void *buf, unsigned int *len) if (hdr->Command =3D=3D SMB2_LOCK) *len -=3D sizeof(struct smb2_lock_element); =20 - if (has_smb2_data_area[le16_to_cpu(hdr->Command)] =3D=3D false) + if (!has_smb2_data_area[le16_to_cpu(hdr->Command)]) goto calc_size_exit; =20 ret =3D smb2_get_data_area_len(&offset, &data_length, hdr); diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c index de40ef7ac26a..8a62cd40c89a 100644 --- a/fs/smb/server/smb2pdu.c +++ b/fs/smb/server/smb2pdu.c @@ -1488,7 +1488,7 @@ static int ntlm_authenticate(struct ksmbd_work *work, * Reuse session if anonymous try to connect * on reauthetication. */ - if (conn->binding =3D=3D false && ksmbd_anonymous_user(user)) { + if (!conn->binding && ksmbd_anonymous_user(user)) { ksmbd_free_user(user); return 0; } @@ -1502,7 +1502,7 @@ static int ntlm_authenticate(struct ksmbd_work *work, sess->user =3D user; } =20 - if (conn->binding =3D=3D false && user_guest(sess->user)) { + if (!conn->binding && user_guest(sess->user)) { rsp->SessionFlags =3D SMB2_SESSION_FLAG_IS_GUEST_LE; } else { struct authenticate_message *authblob; @@ -2945,7 +2945,7 @@ int smb2_open(struct ksmbd_work *work) =20 ksmbd_debug(SMB, "converted name =3D %s\n", name); =20 - if (posix_ctxt =3D=3D false) { + if (!posix_ctxt) { if (strchr(name, ':')) { if (!test_share_config_flag(work->tcon->share_conf, KSMBD_SHARE_FLAG_STREAMS)) { @@ -3553,7 +3553,7 @@ int smb2_open(struct ksmbd_work *work) query_disk_id =3D 1; } =20 - if (conn->is_aapl =3D=3D false) { + if (!conn->is_aapl) { context =3D smb2_find_context_vals(req, SMB2_CREATE_AAPL, 4); if (IS_ERR(context)) { rc =3D PTR_ERR(context); @@ -4874,7 +4874,7 @@ static int get_file_standard_info(struct smb2_query_i= nfo_rsp *rsp, sinfo =3D (struct smb2_file_standard_info *)rsp->Buffer; delete_pending =3D ksmbd_inode_pending_delete(fp); =20 - if (ksmbd_stream_fd(fp) =3D=3D false) { + if (!ksmbd_stream_fd(fp)) { sinfo->AllocationSize =3D cpu_to_le64(stat.blocks << 9); sinfo->EndOfFile =3D S_ISDIR(stat.mode) ? 0 : cpu_to_le64(stat.size); } else { @@ -4945,7 +4945,7 @@ static int get_file_all_info(struct ksmbd_work *work, file_info->ChangeTime =3D cpu_to_le64(time); file_info->Attributes =3D fp->f_ci->m_fattr; file_info->Pad1 =3D 0; - if (ksmbd_stream_fd(fp) =3D=3D false) { + if (!ksmbd_stream_fd(fp)) { file_info->AllocationSize =3D cpu_to_le64(stat.blocks << 9); file_info->EndOfFile =3D S_ISDIR(stat.mode) ? 0 : cpu_to_le64(stat.size); @@ -4961,7 +4961,7 @@ static int get_file_all_info(struct ksmbd_work *work, file_info->IndexNumber =3D cpu_to_le64(stat.ino); file_info->EASize =3D 0; file_info->AccessFlags =3D fp->daccess; - if (ksmbd_stream_fd(fp) =3D=3D false) + if (!ksmbd_stream_fd(fp)) file_info->CurrentByteOffset =3D cpu_to_le64(fp->filp->f_pos); else file_info->CurrentByteOffset =3D cpu_to_le64(fp->stream.pos); @@ -5152,7 +5152,7 @@ static int get_file_network_open_info(struct smb2_que= ry_info_rsp *rsp, time =3D ksmbd_UnixTimeToNT(stat.ctime); file_info->ChangeTime =3D cpu_to_le64(time); file_info->Attributes =3D fp->f_ci->m_fattr; - if (ksmbd_stream_fd(fp) =3D=3D false) { + if (!ksmbd_stream_fd(fp)) { file_info->AllocationSize =3D cpu_to_le64(stat.blocks << 9); file_info->EndOfFile =3D S_ISDIR(stat.mode) ? 0 : cpu_to_le64(stat.size); } else { @@ -5181,7 +5181,7 @@ static void get_file_position_info(struct smb2_query_= info_rsp *rsp, struct smb2_file_pos_info *file_info; =20 file_info =3D (struct smb2_file_pos_info *)rsp->Buffer; - if (ksmbd_stream_fd(fp) =3D=3D false) + if (!ksmbd_stream_fd(fp)) file_info->CurrentByteOffset =3D cpu_to_le64(fp->filp->f_pos); else file_info->CurrentByteOffset =3D cpu_to_le64(fp->stream.pos); @@ -5274,7 +5274,7 @@ static int find_file_posix_info(struct smb2_query_inf= o_rsp *rsp, file_info->ChangeTime =3D cpu_to_le64(time); file_info->DosAttributes =3D fp->f_ci->m_fattr; file_info->Inode =3D cpu_to_le64(stat.ino); - if (ksmbd_stream_fd(fp) =3D=3D false) { + if (!ksmbd_stream_fd(fp)) { file_info->EndOfFile =3D cpu_to_le64(stat.size); file_info->AllocationSize =3D cpu_to_le64(stat.blocks << 9); } else { @@ -6001,7 +6001,7 @@ static int smb2_rename(struct ksmbd_work *work, if (IS_ERR(new_name)) return PTR_ERR(new_name); =20 - if (fp->is_posix_ctxt =3D=3D false && strchr(new_name, ':')) { + if (!fp->is_posix_ctxt && strchr(new_name, ':')) { int s_type; char *xattr_stream_name, *stream_name =3D NULL; size_t xattr_stream_size; @@ -6283,8 +6283,7 @@ static int set_end_of_file_info(struct ksmbd_work *wo= rk, struct ksmbd_file *fp, * truncate of some filesystem like FAT32 fill zero data in * truncated range. */ - if (inode->i_sb->s_magic !=3D MSDOS_SUPER_MAGIC && - ksmbd_stream_fd(fp) =3D=3D false) { + if (inode->i_sb->s_magic !=3D MSDOS_SUPER_MAGIC && !ksmbd_stream_fd(fp)) { ksmbd_debug(SMB, "truncated to newsize %lld\n", newsize); rc =3D ksmbd_vfs_truncate(work, fp, newsize); if (rc) { @@ -6357,7 +6356,7 @@ static int set_file_position_info(struct ksmbd_file *= fp, return -EINVAL; } =20 - if (ksmbd_stream_fd(fp) =3D=3D false) + if (!ksmbd_stream_fd(fp)) fp->filp->f_pos =3D current_byte_offset; else { if (current_byte_offset > XATTR_SIZE_MAX) @@ -7089,7 +7088,7 @@ int smb2_write(struct ksmbd_work *work) if (le32_to_cpu(req->Flags) & SMB2_WRITEFLAG_WRITE_THROUGH) writethrough =3D true; =20 - if (is_rdma_channel =3D=3D false) { + if (!is_rdma_channel) { if (le16_to_cpu(req->DataOffset) < offsetof(struct smb2_write_req, Buffer)) { err =3D -EINVAL; @@ -8982,8 +8981,7 @@ void smb3_set_sign_rsp(struct ksmbd_work *work) =20 hdr =3D ksmbd_resp_buf_curr(work); =20 - if (conn->binding =3D=3D false && - le16_to_cpu(hdr->Command) =3D=3D SMB2_SESSION_SETUP_HE) { + if (!conn->binding && le16_to_cpu(hdr->Command) =3D=3D SMB2_SESSION_SETUP= _HE) { signing_key =3D work->sess->smb3signingkey; } else { chann =3D lookup_chann_list(work->sess, work->conn); diff --git a/fs/smb/server/smb_common.c b/fs/smb/server/smb_common.c index 1cd7e738434d..aeaf1cffa0da 100644 --- a/fs/smb/server/smb_common.c +++ b/fs/smb/server/smb_common.c @@ -415,7 +415,7 @@ int ksmbd_init_smb_server(struct ksmbd_conn *conn) __le32 proto; =20 proto =3D *(__le32 *)rcv_hdr->Protocol; - if (conn->need_neg =3D=3D false) { + if (!conn->need_neg) { if (proto =3D=3D SMB1_PROTO_NUMBER) return -EINVAL; return 0; diff --git a/fs/smb/server/transport_rdma.c b/fs/smb/server/transport_rdma.c index e4273932e7e4..7f868162ace5 100644 --- a/fs/smb/server/transport_rdma.c +++ b/fs/smb/server/transport_rdma.c @@ -2785,7 +2785,7 @@ static bool ksmbd_find_rdma_capable_netdev(struct net= _device *netdev) out: read_unlock(&smb_direct_device_lock); =20 - if (rdma_capable =3D=3D false) { + if (!rdma_capable) { struct ib_device *ibdev; =20 ibdev =3D ib_device_get_by_netdev(netdev, RDMA_DRIVER_UNKNOWN); diff --git a/fs/smb/server/vfs_cache.c b/fs/smb/server/vfs_cache.c index ea9c237b2bca..0f8009c136ed 100644 --- a/fs/smb/server/vfs_cache.c +++ b/fs/smb/server/vfs_cache.c @@ -810,7 +810,7 @@ static int ksmbd_durable_scavenger(void *dummy) found_fp_timeout =3D false; =20 remaining_jiffies =3D wait_event_timeout(dh_wq, - ksmbd_durable_scavenger_alive() =3D=3D false, + !ksmbd_durable_scavenger_alive(), __msecs_to_jiffies(min_timeout)); if (remaining_jiffies) min_timeout =3D jiffies_to_msecs(remaining_jiffies); @@ -846,7 +846,7 @@ static int ksmbd_durable_scavenger(void *dummy) =20 ksmbd_scavenger_dispose_dh(&scavenger_list); =20 - if (found_fp_timeout =3D=3D false) + if (!found_fp_timeout) break; } =20 --=20 2.53.0