Skip to contentSkip to conversation

btrfs: initialize ret at declaration and remove redundant assignment

PATCH New Burenchev Evgenii 1 participant 1 message Feb 25 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH v2 2/2 btrfs: initialize ret at declaration and remove redundant assignment

Related discussion: https://lore.kernel.org/linux-btrfs/[email protected]

Initialize ret at declaration and remove a redundant "ret = 0" before the out: label.

This matches the usual return value handling pattern used in similar functions.

No functional change.

Changes since v1:
- split from original patch

---
 fs/btrfs/ioctl.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
fs/btrfs/ioctl.c +1 -2
index 3a45ee1a7026..de59eacc33b4 100644
@@ -1647,7 +1647,7 @@ static noinline int btrfs_search_path_in_tree(struct btrfs_fs_info *info,
 	struct btrfs_root *root;
 	struct btrfs_key key;
 	char *ptr;
-	int ret = -1;
+	int ret = 0;
 	int slot;
 	int len;
 	int total_len = 0;
@@ -1710,7 +1710,6 @@ static noinline int btrfs_search_path_in_tree(struct btrfs_fs_info *info,
 	}
 	memmove(name, ptr, total_len);
 	name[total_len] = '\0';
-	ret = 0;
 out:
 	btrfs_put_root(root);
 	return ret;
Signature · 1 line
2.43.0