staging: erofs: fix if assignment style issue
authorKristaps Čivkulis <kristaps.civkulis@gmail.com>
Sun, 5 Aug 2018 15:21:01 +0000 (18:21 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 5 Aug 2018 18:16:32 +0000 (20:16 +0200)
Fix coding style issue "do not use assignment in if condition"
detected by checkpatch.pl.

Signed-off-by: Kristaps Čivkulis <kristaps.civkulis@gmail.com>
Reviewed-by: Gao Xiang <gaoxiang25@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/erofs/unzip_vle.c
drivers/staging/erofs/xattr.c

index 1030ca5c2dc33c4079c24d29e2e62eccad7ccb5d..45b1255f5a22dc69f7e26346a38a8f387e9ee9ad 100644 (file)
@@ -702,7 +702,8 @@ next_part:
        /* can be used for verification */
        map->m_llen = offset + cur - map->m_la;
 
-       if ((end = cur) > 0)
+       end = cur;
+       if (end > 0)
                goto repeat;
 
        /* FIXME! avoid the last relundant fixup & endio */
index 6b9685fa601c70c8e52292af8c3c76fcf1d82286..0e9cfeccdf99789dbccfca79568f9e191f7cd9e4 100644 (file)
@@ -288,8 +288,8 @@ static int inline_getxattr(struct inode *inode, struct getxattr_iter *it)
 
        remaining = ret;
        while (remaining) {
-               if ((ret = xattr_foreach(&it->it,
-                       &find_xattr_handlers, &remaining)) >= 0)
+               ret = xattr_foreach(&it->it, &find_xattr_handlers, &remaining);
+               if (ret >= 0)
                        break;
        }
        xattr_iter_end(&it->it, true);
@@ -321,8 +321,8 @@ static int shared_getxattr(struct inode *inode, struct getxattr_iter *it)
                        it->it.blkaddr = blkaddr;
                }
 
-               if ((ret = xattr_foreach(&it->it,
-                       &find_xattr_handlers, NULL)) >= 0)
+               ret = xattr_foreach(&it->it, &find_xattr_handlers, NULL);
+               if (ret >= 0)
                        break;
        }
        if (vi->xattr_shared_count)
@@ -512,8 +512,8 @@ static int inline_listxattr(struct listxattr_iter *it)
 
        remaining = ret;
        while (remaining) {
-               if ((ret = xattr_foreach(&it->it,
-                       &list_xattr_handlers, &remaining)) < 0)
+               ret = xattr_foreach(&it->it, &list_xattr_handlers, &remaining);
+               if (ret < 0)
                        break;
        }
        xattr_iter_end(&it->it, true);
@@ -544,8 +544,8 @@ static int shared_listxattr(struct listxattr_iter *it)
                        it->it.blkaddr = blkaddr;
                }
 
-               if ((ret = xattr_foreach(&it->it,
-                       &list_xattr_handlers, NULL)) < 0)
+               ret = xattr_foreach(&it->it, &list_xattr_handlers, NULL);
+               if (ret < 0)
                        break;
        }
        if (vi->xattr_shared_count)