From: Hariprasad Kelam <hariprasad.kelam@gmail.com>
To: Chris Mason <clm@fb.com>, Josef Bacik <josef@toxicpanda.com>,
David Sterba <dsterba@suse.com>,
linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] fs: btrfs: extent_map: Change return type of unpin_extent_cache
Date: Tue, 2 Jul 2019 08:40:43 +0530 [thread overview]
Message-ID: <20190702031043.GA24334@hari-Inspiron-1545> (raw)
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 <hariprasad.kelam@gmail.com>
---
fs/btrfs/extent_map.c | 5 +----
fs/btrfs/extent_map.h | 2 +-
2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c
index 9558d79..2b0eaa1 100644
--- a/fs/btrfs/extent_map.c
+++ b/fs/btrfs/extent_map.c
@@ -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)
diff --git a/fs/btrfs/extent_map.h b/fs/btrfs/extent_map.h
index 473f039..9d752ce 100644
--- a/fs/btrfs/extent_map.h
+++ b/fs/btrfs/extent_map.h
@@ -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);
--
2.7.4
next reply other threads:[~2019-07-02 3:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-02 3:10 Hariprasad Kelam [this message]
2019-07-02 5:39 ` [PATCH] fs: btrfs: extent_map: Change return type of unpin_extent_cache Nikolay Borisov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190702031043.GA24334@hari-Inspiron-1545 \
--to=hariprasad.kelam@gmail.com \
--cc=clm@fb.com \
--cc=dsterba@suse.com \
--cc=josef@toxicpanda.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).