diff mbox series

[21/29] btrfs: quick_update_accounting rename err to ret2

Message ID 1f4bdab06e7acee3118c0278d7f16a352146ccf5.1710857863.git.anand.jain@oracle.com (mailing list archive)
State New, archived
Headers show
Series trivial adjustments for return variable coding style | expand

Commit Message

Anand Jain March 19, 2024, 2:55 p.m. UTC
In quick_update_accounting err is used as 2nd return value, rename it to
ret2.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
 fs/btrfs/qgroup.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Josef Bacik March 19, 2024, 6:10 p.m. UTC | #1
On Tue, Mar 19, 2024 at 08:25:29PM +0530, Anand Jain wrote:
> In quick_update_accounting err is used as 2nd return value, rename it to
> ret2.
> 
> Signed-off-by: Anand Jain <anand.jain@oracle.com>
> ---
>  fs/btrfs/qgroup.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
> index 5f90f0605b12..23a08910fa67 100644
> --- a/fs/btrfs/qgroup.c
> +++ b/fs/btrfs/qgroup.c
> @@ -1541,16 +1541,16 @@ static int quick_update_accounting(struct btrfs_fs_info *fs_info,
>  {
>  	struct btrfs_qgroup *qgroup;
>  	int ret = 1;
> -	int err = 0;
> +	int ret2 = 0;
>  
>  	qgroup = find_qgroup_rb(fs_info, src);
>  	if (!qgroup)
>  		goto out;
>  	if (qgroup->excl == qgroup->rfer) {
>  		ret = 0;
> -		err = __qgroup_excl_accounting(fs_info, dst, qgroup, sign);
> -		if (err < 0) {
> -			ret = err;
> +		ret2 = __qgroup_excl_accounting(fs_info, dst, qgroup, sign);
> +		if (ret2 < 0) {
> +			ret = ret2;
>  			goto out;
>  		}

This can be reworked to

ret = __qgroup_excl_accounting(fs_info, dst, qgroup, sign);
if (ret < 0)
	goto out;
ret = 0;

Thanks,

Josef
diff mbox series

Patch

diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
index 5f90f0605b12..23a08910fa67 100644
--- a/fs/btrfs/qgroup.c
+++ b/fs/btrfs/qgroup.c
@@ -1541,16 +1541,16 @@  static int quick_update_accounting(struct btrfs_fs_info *fs_info,
 {
 	struct btrfs_qgroup *qgroup;
 	int ret = 1;
-	int err = 0;
+	int ret2 = 0;
 
 	qgroup = find_qgroup_rb(fs_info, src);
 	if (!qgroup)
 		goto out;
 	if (qgroup->excl == qgroup->rfer) {
 		ret = 0;
-		err = __qgroup_excl_accounting(fs_info, dst, qgroup, sign);
-		if (err < 0) {
-			ret = err;
+		ret2 = __qgroup_excl_accounting(fs_info, dst, qgroup, sign);
+		if (ret2 < 0) {
+			ret = ret2;
 			goto out;
 		}
 	}