All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btrfs: qgroup: move the qgroup->members check out from (!qgroup)'s else branch
@ 2018-10-11  5:42 Lu Fengqi
  2018-10-11  6:42 ` Nikolay Borisov
  2018-10-11 11:38 ` David Sterba
  0 siblings, 2 replies; 3+ messages in thread
From: Lu Fengqi @ 2018-10-11  5:42 UTC (permalink / raw)
  To: linux-btrfs

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
indent.

No Functional Change.

Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com>
---
 fs/btrfs/qgroup.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
index 27f517315388..af65ab1640b0 100644
--- a/fs/btrfs/qgroup.c
+++ b/fs/btrfs/qgroup.c
@@ -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;
-- 
2.19.1




^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] btrfs: qgroup: move the qgroup->members check out from (!qgroup)'s else branch
  2018-10-11  5:42 [PATCH] btrfs: qgroup: move the qgroup->members check out from (!qgroup)'s else branch Lu Fengqi
@ 2018-10-11  6:42 ` Nikolay Borisov
  2018-10-11 11:38 ` David Sterba
  1 sibling, 0 replies; 3+ messages in thread
From: Nikolay Borisov @ 2018-10-11  6:42 UTC (permalink / raw)
  To: Lu Fengqi, linux-btrfs



On 11.10.2018 08:42, Lu Fengqi wrote:
> 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
> indent.
> 
> No Functional Change.
> 
> Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com>

Reviewed-by: Nikolay Borisov <nborisov@suse.com>

> ---
>  fs/btrfs/qgroup.c | 13 +++++++------
>  1 file changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
> index 27f517315388..af65ab1640b0 100644
> --- a/fs/btrfs/qgroup.c
> +++ b/fs/btrfs/qgroup.c
> @@ -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;
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] btrfs: qgroup: move the qgroup->members check out from (!qgroup)'s else branch
  2018-10-11  5:42 [PATCH] btrfs: qgroup: move the qgroup->members check out from (!qgroup)'s else branch Lu Fengqi
  2018-10-11  6:42 ` Nikolay Borisov
@ 2018-10-11 11:38 ` David Sterba
  1 sibling, 0 replies; 3+ messages in thread
From: David Sterba @ 2018-10-11 11:38 UTC (permalink / raw)
  To: Lu Fengqi; +Cc: linux-btrfs

On Thu, Oct 11, 2018 at 01:42:56PM +0800, Lu Fengqi wrote:
> 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
> indent.
> 
> No Functional Change.
> 
> Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com>

Added to misc-next, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-10-11 11:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-11  5:42 [PATCH] btrfs: qgroup: move the qgroup->members check out from (!qgroup)'s else branch Lu Fengqi
2018-10-11  6:42 ` Nikolay Borisov
2018-10-11 11:38 ` David Sterba

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.