All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Staging: lustre: llite_lib: Remove unnecessary NULL check
@ 2015-10-15 12:54 Shivani Bhardwaj
  0 siblings, 0 replies; only message in thread
From: Shivani Bhardwaj @ 2015-10-15 12:54 UTC (permalink / raw)
  To: outreachy-kernel

Variable op_data is already tested for NULL value and therefore any
further checks should be removed.
Semantic patch used:

@@ expression E;@@
if(E==NULL) {... return ...;}
- if(E){
  ...
- }

Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
---
 drivers/staging/lustre/lustre/llite/llite_lib.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c
index e3ea477..e874e63 100644
--- a/drivers/staging/lustre/lustre/llite/llite_lib.c
+++ b/drivers/staging/lustre/lustre/llite/llite_lib.c
@@ -1350,14 +1350,13 @@ int ll_setattr_raw(struct dentry *dentry, struct iattr *attr, bool hsm_import)
 			up_write(&lli->lli_trunc_sem);
 	}
 out:
-	if (op_data) {
-		if (op_data->op_ioepoch) {
-			rc1 = ll_setattr_done_writing(inode, op_data, mod);
-			if (!rc)
-				rc = rc1;
-		}
-		ll_finish_md_op_data(op_data);
+	if (op_data->op_ioepoch) {
+		rc1 = ll_setattr_done_writing(inode, op_data, mod);
+		if (!rc)
+			rc = rc1;
 	}
+	ll_finish_md_op_data(op_data);
+
 	if (!S_ISDIR(inode->i_mode)) {
 		mutex_lock(&inode->i_mutex);
 		if ((attr->ia_valid & ATTR_SIZE) && !hsm_import)
-- 
2.1.0



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-10-15 12:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-15 12:54 [PATCH] Staging: lustre: llite_lib: Remove unnecessary NULL check Shivani Bhardwaj

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.