]> git.karo-electronics.de Git - linux-beck.git/commitdiff
Staging: lustre: llite_lib: Remove unnecessary NULL check
authorShivani Bhardwaj <shivanib134@gmail.com>
Thu, 15 Oct 2015 12:54:05 +0000 (18:24 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 17 Oct 2015 05:29:33 +0000 (22:29 -0700)
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/llite/llite_lib.c

index e3ea477b9f39ef61de8b3188552b46c14e4f76ab..e874e631e0060187ec0e1bd5a488b46a5a33c4c0 100644 (file)
@@ -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)