Skip to content

Commit 8d606c3

Browse files
Dan Carpentersmfrench
authored andcommitted
cifs: make cifs_chan_update_iface() a void function
The return values for cifs_chan_update_iface() didn't match what the documentation said and nothing was checking them anyway. Just make it a void function. Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent c3a11c0 commit 8d606c3

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

fs/smb/client/cifsproto.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ cifs_chan_is_iface_active(struct cifs_ses *ses,
656656
struct TCP_Server_Info *server);
657657
void
658658
cifs_disable_secondary_channels(struct cifs_ses *ses);
659-
int
659+
void
660660
cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server);
661661
int
662662
SMB3_request_interfaces(const unsigned int xid, struct cifs_tcon *tcon, bool in_mount);

fs/smb/client/sess.c

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -356,10 +356,9 @@ cifs_disable_secondary_channels(struct cifs_ses *ses)
356356

357357
/*
358358
* update the iface for the channel if necessary.
359-
* will return 0 when iface is updated, 1 if removed, 2 otherwise
360359
* Must be called with chan_lock held.
361360
*/
362-
int
361+
void
363362
cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server)
364363
{
365364
unsigned int chan_index;
@@ -368,20 +367,19 @@ cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server)
368367
struct cifs_server_iface *old_iface = NULL;
369368
struct cifs_server_iface *last_iface = NULL;
370369
struct sockaddr_storage ss;
371-
int rc = 0;
372370

373371
spin_lock(&ses->chan_lock);
374372
chan_index = cifs_ses_get_chan_index(ses, server);
375373
if (chan_index == CIFS_INVAL_CHAN_INDEX) {
376374
spin_unlock(&ses->chan_lock);
377-
return 0;
375+
return;
378376
}
379377

380378
if (ses->chans[chan_index].iface) {
381379
old_iface = ses->chans[chan_index].iface;
382380
if (old_iface->is_active) {
383381
spin_unlock(&ses->chan_lock);
384-
return 1;
382+
return;
385383
}
386384
}
387385
spin_unlock(&ses->chan_lock);
@@ -394,7 +392,7 @@ cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server)
394392
if (!ses->iface_count) {
395393
spin_unlock(&ses->iface_lock);
396394
cifs_dbg(VFS, "server %s does not advertise interfaces\n", ses->server->hostname);
397-
return 0;
395+
return;
398396
}
399397

400398
last_iface = list_last_entry(&ses->iface_list, struct cifs_server_iface,
@@ -434,7 +432,6 @@ cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server)
434432
}
435433

436434
if (list_entry_is_head(iface, &ses->iface_list, iface_head)) {
437-
rc = 1;
438435
iface = NULL;
439436
cifs_dbg(FYI, "unable to find a suitable iface\n");
440437
}
@@ -449,7 +446,7 @@ cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server)
449446
}
450447

451448
spin_unlock(&ses->iface_lock);
452-
return 0;
449+
return;
453450
}
454451

455452
/* now drop the ref to the current iface */
@@ -478,13 +475,13 @@ cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server)
478475
chan_index = cifs_ses_get_chan_index(ses, server);
479476
if (chan_index == CIFS_INVAL_CHAN_INDEX) {
480477
spin_unlock(&ses->chan_lock);
481-
return 0;
478+
return;
482479
}
483480

484481
ses->chans[chan_index].iface = iface;
485482
spin_unlock(&ses->chan_lock);
486483

487-
return rc;
484+
return;
488485
}
489486

490487
/*

0 commit comments

Comments
 (0)