diff mbox series

[14/29] btrfs: build_backref_tree rename err to ret and ret to ret2

Message ID e637177cc89d0b5d5b5fddd343b98c452c70227e.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
Code sytle fix in the function build_backref_tree().

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

Comments

Josef Bacik March 19, 2024, 5:57 p.m. UTC | #1
On Tue, Mar 19, 2024 at 08:25:22PM +0530, Anand Jain wrote:
> Code sytle fix in the function build_backref_tree().
> 

This doesn't need 2 ret values, we can get away with just one here.  Thanks,

Josef
diff mbox series

Patch

diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
index f96f267fb4aa..535d5657777b 100644
--- a/fs/btrfs/relocation.c
+++ b/fs/btrfs/relocation.c
@@ -472,21 +472,21 @@  static noinline_for_stack struct btrfs_backref_node *build_backref_tree(
 	struct btrfs_backref_node *cur;
 	struct btrfs_backref_node *node = NULL;
 	struct btrfs_backref_edge *edge;
-	int ret;
-	int err = 0;
+	int ret = 0;
+	int ret2;
 
 	iter = btrfs_backref_iter_alloc(rc->extent_root->fs_info);
 	if (!iter)
 		return ERR_PTR(-ENOMEM);
 	path = btrfs_alloc_path();
 	if (!path) {
-		err = -ENOMEM;
+		ret = -ENOMEM;
 		goto out;
 	}
 
 	node = btrfs_backref_alloc_node(cache, bytenr, level);
 	if (!node) {
-		err = -ENOMEM;
+		ret = -ENOMEM;
 		goto out;
 	}
 
@@ -495,10 +495,10 @@  static noinline_for_stack struct btrfs_backref_node *build_backref_tree(
 
 	/* Breadth-first search to build backref cache */
 	do {
-		ret = btrfs_backref_add_tree_node(trans, cache, path, iter,
+		ret2 = btrfs_backref_add_tree_node(trans, cache, path, iter,
 						  node_key, cur);
-		if (ret < 0) {
-			err = ret;
+		if (ret2 < 0) {
+			ret = ret2;
 			goto out;
 		}
 		edge = list_first_entry_or_null(&cache->pending_edge,
@@ -514,9 +514,9 @@  static noinline_for_stack struct btrfs_backref_node *build_backref_tree(
 	} while (edge);
 
 	/* Finish the upper linkage of newly added edges/nodes */
-	ret = btrfs_backref_finish_upper_links(cache, node);
-	if (ret < 0) {
-		err = ret;
+	ret2 = btrfs_backref_finish_upper_links(cache, node);
+	if (ret2 < 0) {
+		ret = ret2;
 		goto out;
 	}
 
@@ -526,9 +526,9 @@  static noinline_for_stack struct btrfs_backref_node *build_backref_tree(
 	btrfs_free_path(iter->path);
 	kfree(iter);
 	btrfs_free_path(path);
-	if (err) {
+	if (ret) {
 		btrfs_backref_error_cleanup(cache, node);
-		return ERR_PTR(err);
+		return ERR_PTR(ret);
 	}
 	ASSERT(!node || !node->detached);
 	ASSERT(list_empty(&cache->useless_node) &&