Skip to contentSkip to conversation

Staging: lustre: llite_lib: Remove unnecessary NULL check

PATCH New Shivani Bhardwaj 1 participant 1 message Oct 15, 2015 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: lustre: llite_lib: Remove unnecessary NULL check

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){
...
- }

---
 drivers/staging/lustre/lustre/llite/llite_lib.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
drivers/staging/lustre/lustre/llite/llite_lib.c +6 -7
index e3ea477..e874e63 100644
@@ -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)
Signature · 1 line
2.1.0