btrfs: qgroup: move the qgroup->members check out from (!qgroup)'s else branch
authorLu Fengqi <lufq.fnst@cn.fujitsu.com>
Thu, 11 Oct 2018 05:42:56 +0000 (13:42 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 15 Oct 2018 15:23:40 +0000 (17:23 +0200)
There is no reason to put this check in (!qgroup)'s else branch because
if qgroup is null, it will goto out directly. So move it out to reduce
indentation level.  No functional change.

Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/qgroup.c

index 27f517315388b7de8827c3f9d1c516c185ee5c5a..45868fd76209024dc2cfc790801ffac9133a3ef1 100644 (file)
@@ -1416,13 +1416,14 @@ int btrfs_remove_qgroup(struct btrfs_trans_handle *trans, u64 qgroupid)
        if (!qgroup) {
                ret = -ENOENT;
                goto out;
-       } else {
-               /* check if there are no children of this qgroup */
-               if (!list_empty(&qgroup->members)) {
-                       ret = -EBUSY;
-                       goto out;
-               }
        }
+
+       /* Check if there are no children of this qgroup */
+       if (!list_empty(&qgroup->members)) {
+               ret = -EBUSY;
+               goto out;
+       }
+
        ret = del_qgroup_item(trans, qgroupid);
        if (ret && ret != -ENOENT)
                goto out;