From ed48adf83e09041d7ec3ec9ef256f1b3f660c52d Mon Sep 17 00:00:00 2001 From: Filipe Manana Date: Tue, 16 Jan 2024 16:00:16 +0000 Subject: btrfs: simplify add_extent_mapping() by removing pointless label The add_extent_mapping() function is short and trivial, there's no need to have a label for a quick exit in case of an error, even because there's no error handling needed, we just need to return the error. So remove that label and return directly. Also while at it remove the redundant initialization of 'ret', as that may help avoid some warnings with clang tools such as the one reported/fixed by commit 966de47ff0c9 ("btrfs: remove redundant initialization of variables in log_new_ancestors"). Reviewed-by: Qu Wenruo Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba --- fs/btrfs/extent_map.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'fs/btrfs') diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c index ac4361792ffc..4a9fbcb24d9b 100644 --- a/fs/btrfs/extent_map.c +++ b/fs/btrfs/extent_map.c @@ -370,17 +370,17 @@ static inline void setup_extent_mapping(struct extent_map_tree *tree, static int add_extent_mapping(struct extent_map_tree *tree, struct extent_map *em, int modified) { - int ret = 0; + int ret; lockdep_assert_held_write(&tree->lock); ret = tree_insert(&tree->map, em); if (ret) - goto out; + return ret; setup_extent_mapping(tree, em, modified); -out: - return ret; + + return 0; } static struct extent_map * -- cgit v1.2.3