fs:btrfs: remove unneeded variable
PATCH 1/1 fs:btrfs: remove unneeded variable
From: chiminghao <[email protected]>
Fix the following coccicheck REVIEW:
./fs/btrfs/extent_map.c:299:5-8 REVIEW Unneeded variable
Reported-by Zeal Robot <[email protected]>
Signed-off-by chiminghao <[email protected]>
--- fs/btrfs/extent_map.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
fs/btrfs/extent_map.c +1 -2
@@ -296,7 +296,6 @@ static void try_merge_map(struct extent_map_tree *tree, struct extent_map *em)int unpin_extent_cache (struct extent_map_tree *tree,u64 start,u64 len,u64 gen) { -int ret =0 ;struct extent_map *em;bool prealloc = false;
@@ -328,7 +327,7 @@ int unpin_extent_cache(struct extent_map_tree *tree, u64 start, u64 len,free_extent_map (em); out:write_unlock (&tree->lock); -return ret; +return 0 ; }
Signature · 1 line
2.25.1
Quoted 7 lines · On 2021/11/12 10:49, [email protected] wrote:
From: chiminghao <[email protected]>
Fix the following coccicheck REVIEW:
./fs/btrfs/extent_map.c:299:5-8 REVIEW Unneeded variableReported-by Zeal Robot <[email protected]>Signed-off-by chiminghao <[email protected]>
IIRC the @ret is reserved there as we're not handling the !em case with error number, nor is the only caller properly handling the possible error.
Thanks,
Qu
Quoted 26 lines
--- fs/btrfs/extent_map.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)fs/btrfs/extent_map.c +1
-2@@ -296,7 +296,6 @@ static void try_merge_map(struct extent_map_tree *tree, struct extent_map *em)int unpin_extent_cache (struct extent_map_tree *tree,u64 start,u64 len,u64 gen) { -int ret =0 ;struct extent_map *em;bool prealloc = false;@@ -328,7 +327,7 @@ int unpin_extent_cache(struct extent_map_tree *tree, u64 start, u64 len,free_extent_map (em); out:write_unlock (&tree->lock); -return ret; +return 0 ; }