Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Lu Fengqi <lufq.fnst@cn.fujitsu.com>
To: zhong jiang <zhongjiang@huawei.com>
Cc: <clm@fb.com>, <jbacik@fb.com>, <dsterba@suse.com>,
	<linux-btrfs@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] btrfs/extent_map: Remove unneeded variable "ret"
Date: Sat, 4 Aug 2018 20:59:48 +0800	[thread overview]
Message-ID: <20180804125947.GF2049@fnst.localdomain> (raw)
In-Reply-To: <1533381223-16734-1-git-send-email-zhongjiang@huawei.com>

On Sat, Aug 04, 2018 at 07:13:43PM +0800, zhong jiang wrote:
>The ret is not used after initalization, So just remove it.

So why not change these two functions to void function?

-- 
Thanks,
Lu

>
>Signed-off-by: zhong jiang <zhongjiang@huawei.com>
>---
> fs/btrfs/extent_map.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
>diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c
>index 6648d55..b48ab41 100644
>--- a/fs/btrfs/extent_map.c
>+++ b/fs/btrfs/extent_map.c
>@@ -276,7 +276,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;
> 
>@@ -308,7 +307,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;
> 
> }
> 
>@@ -430,14 +429,13 @@ struct extent_map *search_extent_mapping(struct extent_map_tree *tree,
>  */
> int remove_extent_mapping(struct extent_map_tree *tree, struct extent_map *em)
> {
>-	int ret = 0;
>-
> 	WARN_ON(test_bit(EXTENT_FLAG_PINNED, &em->flags));
> 	rb_erase(&em->rb_node, &tree->map);
> 	if (!test_bit(EXTENT_FLAG_LOGGING, &em->flags))
> 		list_del_init(&em->list);
> 	RB_CLEAR_NODE(&em->rb_node);
>-	return ret;
>+
>+	return 0;
> }
> 
> void replace_extent_mapping(struct extent_map_tree *tree,
>-- 
>1.7.12.4
>
>--
>To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>



  parent reply	other threads:[~2018-08-04 15:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-04 11:13 [PATCH] btrfs/extent_map: Remove unneeded variable "ret" zhong jiang
2018-08-04 12:29 ` Su Yue
2018-08-04 12:59 ` Lu Fengqi [this message]
2018-08-04 13:19   ` zhong jiang
2018-08-04 16:35     ` Lu Fengqi

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=20180804125947.GF2049@fnst.localdomain \
    --to=lufq.fnst@cn.fujitsu.com \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=jbacik@fb.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zhongjiang@huawei.com \
    /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