fs: btrfs: extent_map: Change return type of unpin_extent_cache
PATCH 1/1 fs: btrfs: extent_map: Change return type of unpin_extent_cache
As unpin_extent_cache never fails and Caller does not expect return value we can change return value from int to void.
Issue identified with coccicheck fs/btrfs/extent_map.c:284:5-8: Unneeded variable: "ret". Return "0" on line 316
Signed-off-by Hariprasad Kelam <[email protected]>
--- fs/btrfs/extent_map.c | 5 +---- fs/btrfs/extent_map.h | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-)
fs/btrfs/extent_map.c +1 -4
@@ -278,10 +278,9 @@ static void try_merge_map(struct extent_map_tree *tree, struct extent_map *em)* to the generation that actually added the file item to the inode so we know * we need to sync this extent when we call fsync(). */ -int unpin_extent_cache (struct extent_map_tree *tree,u64 start,u64 len, +void unpin_extent_cache (struct extent_map_tree *tree,u64 start,u64 len,u64 gen) { -int ret =0 ;struct extent_map *em;bool prealloc = false;
@@ -313,8 +312,6 @@ int unpin_extent_cache(struct extent_map_tree *tree, u64 start, u64 len,free_extent_map (em); out:write_unlock (&tree->lock); -return ret; - }void clear_em_logging (struct extent_map_tree *tree,struct extent_map *em)
fs/btrfs/extent_map.h +1 -1
@@ -96,7 +96,7 @@ struct extent_map *alloc_extent_map(void);void free_extent_map (struct extent_map *em);int __init extent_map_init (void );void __cold extent_map_exit (void ); -int unpin_extent_cache (struct extent_map_tree *tree,u64 start,u64 len,u64 gen); +void unpin_extent_cache (struct extent_map_tree *tree,u64 start,u64 len,u64 gen);void clear_em_logging (struct extent_map_tree *tree,struct extent_map *em);struct extent_map *search_extent_mapping (struct extent_map_tree *tree,u64 start,u64 len);
Signature · 1 line
2.7.4
Quoted 8 lines · Hariprasad Kelam
As
unpin_extent_cachenever fails and Caller does not expect return value we can change return value from int to void.Issue identified with coccicheck fs/btrfs/extent_map.c:284:5-8: Unneeded variable: "ret". Return "0" on line 316
Signed-off-by Hariprasad Kelam <[email protected]>
Reviewed-by Nikolay Borisov <[email protected]>