aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2014-12-02 05:40:33 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-12-02 19:52:37 -0500
commit13cb076d3057e0c4b26acb0ee5e5d6ea9b5131c0 (patch)
treef2d0aec39e0a8e55dc337acaacc3e8c9b03896fa
parent450b31a9d0a601c78995ea0f9cefd07b05a8dc34 (diff)
lustre: Deletion of unnecessary checks before three function calls
The functions free_ll_remote_perm(), free_rmtperm_hash() and iput() test whether their argument is NULL and then return immediately. Thus the test around their calls is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/lustre/lustre/llite/remote_perm.c5
-rw-r--r--drivers/staging/lustre/lustre/llite/statahead.c3
2 files changed, 3 insertions, 5 deletions
diff --git a/drivers/staging/lustre/lustre/llite/remote_perm.c b/drivers/staging/lustre/lustre/llite/remote_perm.c
index c05a9126cfe3..a58182600dae 100644
--- a/drivers/staging/lustre/lustre/llite/remote_perm.c
+++ b/drivers/staging/lustre/lustre/llite/remote_perm.c
@@ -194,7 +194,7 @@ int ll_update_remote_perm(struct inode *inode, struct mdt_remote_perm *perm)
194 194
195 if (!lli->lli_remote_perms) 195 if (!lli->lli_remote_perms)
196 lli->lli_remote_perms = perm_hash; 196 lli->lli_remote_perms = perm_hash;
197 else if (perm_hash) 197 else
198 free_rmtperm_hash(perm_hash); 198 free_rmtperm_hash(perm_hash);
199 199
200 head = lli->lli_remote_perms + remote_perm_hashfunc(perm->rp_uid); 200 head = lli->lli_remote_perms + remote_perm_hashfunc(perm->rp_uid);
@@ -209,8 +209,7 @@ again:
209 continue; 209 continue;
210 if (tmp->lrp_fsgid != perm->rp_fsgid) 210 if (tmp->lrp_fsgid != perm->rp_fsgid)
211 continue; 211 continue;
212 if (lrp) 212 free_ll_remote_perm(lrp);
213 free_ll_remote_perm(lrp);
214 lrp = tmp; 213 lrp = tmp;
215 break; 214 break;
216 } 215 }
diff --git a/drivers/staging/lustre/lustre/llite/statahead.c b/drivers/staging/lustre/lustre/llite/statahead.c
index c4bd09edb0ce..db2bb44cdce5 100644
--- a/drivers/staging/lustre/lustre/llite/statahead.c
+++ b/drivers/staging/lustre/lustre/llite/statahead.c
@@ -334,8 +334,7 @@ static void ll_sa_entry_put(struct ll_statahead_info *sai,
334 LASSERT(ll_sa_entry_unhashed(entry)); 334 LASSERT(ll_sa_entry_unhashed(entry));
335 335
336 ll_sa_entry_cleanup(sai, entry); 336 ll_sa_entry_cleanup(sai, entry);
337 if (entry->se_inode) 337 iput(entry->se_inode);
338 iput(entry->se_inode);
339 338
340 OBD_FREE(entry, entry->se_size); 339 OBD_FREE(entry, entry->se_size);
341 atomic_dec(&sai->sai_cache_count); 340 atomic_dec(&sai->sai_cache_count);