[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <eef8b278-97b5-4858-b05f-5cfc454cc614@moroto.mountain>
Date: Mon, 8 Jan 2024 12:09:27 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Steve French <sfrench@...ba.org>
Cc: Paulo Alcantara <pc@...guebit.com>,
Ronnie Sahlberg <lsahlber@...hat.com>,
Shyam Prasad N <sprasad@...rosoft.com>, Tom Talpey <tom@...pey.com>,
linux-cifs@...r.kernel.org, samba-technical@...ts.samba.org,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: [PATCH 3/3] cifs: simplify a check in cifs_chan_update_iface()
The loop iterator in a list_for_each() loop is never NULL at the end.
This condition uses a two step process of setting the iterator, "iface",
from non-NULL to NULL and then checking if it's NULL. It's easier to do
in one step.
Signed-off-by: Dan Carpenter <dan.carpenter@...aro.org>
---
fs/smb/client/sess.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/fs/smb/client/sess.c b/fs/smb/client/sess.c
index f7b216dd06b2..987188e1929e 100644
--- a/fs/smb/client/sess.c
+++ b/fs/smb/client/sess.c
@@ -363,7 +363,7 @@ cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server)
{
unsigned int chan_index;
size_t iface_weight = 0, iface_min_speed = 0;
- struct cifs_server_iface *iface = NULL;
+ struct cifs_server_iface *iface;
struct cifs_server_iface *old_iface = NULL;
struct cifs_server_iface *last_iface = NULL;
struct sockaddr_storage ss;
@@ -432,11 +432,6 @@ cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server)
}
if (list_entry_is_head(iface, &ses->iface_list, iface_head)) {
- iface = NULL;
- cifs_dbg(FYI, "unable to find a suitable iface\n");
- }
-
- if (!iface) {
if (!chan_index)
cifs_dbg(FYI, "unable to get the interface matching: %pIS\n",
&ss);
--
2.42.0
Powered by blists - more mailing lists