mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-05 22:08:18 +00:00
NFS: Deletion of unnecessary checks before the function call "nfs_put_client"
The nfs_put_client() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
This commit is contained in:
parent
1306729b0d
commit
fe0bf1185d
2 changed files with 6 additions and 12 deletions
|
@ -204,7 +204,6 @@ destroy_ds(struct nfs4_pnfs_ds *ds)
|
||||||
ifdebug(FACILITY)
|
ifdebug(FACILITY)
|
||||||
print_ds(ds);
|
print_ds(ds);
|
||||||
|
|
||||||
if (ds->ds_clp)
|
|
||||||
nfs_put_client(ds->ds_clp);
|
nfs_put_client(ds->ds_clp);
|
||||||
|
|
||||||
while (!list_empty(&ds->ds_addrs)) {
|
while (!list_empty(&ds->ds_addrs)) {
|
||||||
|
|
|
@ -498,7 +498,6 @@ int nfs40_walk_client_list(struct nfs_client *new,
|
||||||
atomic_inc(&pos->cl_count);
|
atomic_inc(&pos->cl_count);
|
||||||
spin_unlock(&nn->nfs_client_lock);
|
spin_unlock(&nn->nfs_client_lock);
|
||||||
|
|
||||||
if (prev)
|
|
||||||
nfs_put_client(prev);
|
nfs_put_client(prev);
|
||||||
prev = pos;
|
prev = pos;
|
||||||
|
|
||||||
|
@ -517,7 +516,6 @@ int nfs40_walk_client_list(struct nfs_client *new,
|
||||||
atomic_inc(&pos->cl_count);
|
atomic_inc(&pos->cl_count);
|
||||||
spin_unlock(&nn->nfs_client_lock);
|
spin_unlock(&nn->nfs_client_lock);
|
||||||
|
|
||||||
if (prev)
|
|
||||||
nfs_put_client(prev);
|
nfs_put_client(prev);
|
||||||
prev = pos;
|
prev = pos;
|
||||||
|
|
||||||
|
@ -549,7 +547,6 @@ int nfs40_walk_client_list(struct nfs_client *new,
|
||||||
|
|
||||||
/* No match found. The server lost our clientid */
|
/* No match found. The server lost our clientid */
|
||||||
out:
|
out:
|
||||||
if (prev)
|
|
||||||
nfs_put_client(prev);
|
nfs_put_client(prev);
|
||||||
dprintk("NFS: <-- %s status = %d\n", __func__, status);
|
dprintk("NFS: <-- %s status = %d\n", __func__, status);
|
||||||
return status;
|
return status;
|
||||||
|
@ -641,7 +638,6 @@ int nfs41_walk_client_list(struct nfs_client *new,
|
||||||
atomic_inc(&pos->cl_count);
|
atomic_inc(&pos->cl_count);
|
||||||
spin_unlock(&nn->nfs_client_lock);
|
spin_unlock(&nn->nfs_client_lock);
|
||||||
|
|
||||||
if (prev)
|
|
||||||
nfs_put_client(prev);
|
nfs_put_client(prev);
|
||||||
prev = pos;
|
prev = pos;
|
||||||
|
|
||||||
|
@ -675,7 +671,6 @@ int nfs41_walk_client_list(struct nfs_client *new,
|
||||||
/* No matching nfs_client found. */
|
/* No matching nfs_client found. */
|
||||||
spin_unlock(&nn->nfs_client_lock);
|
spin_unlock(&nn->nfs_client_lock);
|
||||||
dprintk("NFS: <-- %s status = %d\n", __func__, status);
|
dprintk("NFS: <-- %s status = %d\n", __func__, status);
|
||||||
if (prev)
|
|
||||||
nfs_put_client(prev);
|
nfs_put_client(prev);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue