mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-04 08:17:46 +00:00
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 966de47ff0
("btrfs: remove redundant initialization of
variables in log_new_ancestors").
Reviewed-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
071533da5f
commit
ed48adf83e
1 changed files with 4 additions and 4 deletions
|
@ -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 *
|
||||
|
|
Loading…
Add table
Reference in a new issue