public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 2/2] btrfs: initialize ret at declaration and remove redundant assignment
@ 2026-02-25 12:41 Burenchev Evgenii
  0 siblings, 0 replies; only message in thread
From: Burenchev Evgenii @ 2026-02-25 12:41 UTC (permalink / raw)
  To: dsterba@suse.cz
  Cc: clm@fb.com, dsterba@suse.com, linux-btrfs@vger.kernel.org,
	linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org,
	mssola@mssola.com, fdmanana@kernel.org


Related discussion: https://lore.kernel.org/linux-btrfs/20260224172835.GB26902@twin.jikos.cz

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

Signed-off-by: Evgenii Burenchev <eburenchev@orionsoft.ru>
---
 fs/btrfs/ioctl.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 3a45ee1a7026..de59eacc33b4 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -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;
-- 
2.43.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-02-25 12:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-25 12:41 [PATCH v2 2/2] btrfs: initialize ret at declaration and remove redundant assignment Burenchev Evgenii

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox