public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btrfs/extent_map: Remove unneeded variable "ret"
@ 2018-08-04 11:13 zhong jiang
  2018-08-04 12:29 ` Su Yue
  2018-08-04 12:59 ` Lu Fengqi
  0 siblings, 2 replies; 5+ messages in thread
From: zhong jiang @ 2018-08-04 11:13 UTC (permalink / raw)
  To: clm, jbacik, dsterba; +Cc: linux-btrfs, linux-kernel

The ret is not used after initalization, So just remove it.

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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] btrfs/extent_map: Remove unneeded variable "ret"
  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
  1 sibling, 0 replies; 5+ messages in thread
From: Su Yue @ 2018-08-04 12:29 UTC (permalink / raw)
  To: zhong jiang, clm, jbacik, dsterba; +Cc: linux-btrfs, linux-kernel, Su Yue



On 2018/8/4 7:13 PM, zhong jiang wrote:
> The ret is not used after initalization, So just remove it.
> 
> Signed-off-by: zhong jiang <zhongjiang@huawei.com>

Reviewed-by: Su Yue <suy.fnst@cn.fujitsu.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,
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] btrfs/extent_map: Remove unneeded variable "ret"
  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
  2018-08-04 13:19   ` zhong jiang
  1 sibling, 1 reply; 5+ messages in thread
From: Lu Fengqi @ 2018-08-04 12:59 UTC (permalink / raw)
  To: zhong jiang; +Cc: clm, jbacik, dsterba, linux-btrfs, linux-kernel

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
>
>



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] btrfs/extent_map: Remove unneeded variable "ret"
  2018-08-04 12:59 ` Lu Fengqi
@ 2018-08-04 13:19   ` zhong jiang
  2018-08-04 16:35     ` Lu Fengqi
  0 siblings, 1 reply; 5+ messages in thread
From: zhong jiang @ 2018-08-04 13:19 UTC (permalink / raw)
  To: Lu Fengqi; +Cc: clm, jbacik, dsterba, linux-btrfs, linux-kernel

On 2018/8/4 20:59, Lu Fengqi wrote:
> 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?
>
 I just keep the original interface  and make the minimal change.
of course,   It is also feasible that make these two functions to void function.

I will repost if  you prefer to that change.  I am ok with that.

Thanks,
zhong jiang


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] btrfs/extent_map: Remove unneeded variable "ret"
  2018-08-04 13:19   ` zhong jiang
@ 2018-08-04 16:35     ` Lu Fengqi
  0 siblings, 0 replies; 5+ messages in thread
From: Lu Fengqi @ 2018-08-04 16:35 UTC (permalink / raw)
  To: zhong jiang; +Cc: clm, jbacik, dsterba, linux-btrfs, linux-kernel

On Sat, Aug 04, 2018 at 09:19:37PM +0800, zhong jiang wrote:
>On 2018/8/4 20:59, Lu Fengqi wrote:
>> 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?
>>
> I just keep the original interface  and make the minimal change.
>of course,   It is also feasible that make these two functions to void function.
>
>I will repost if  you prefer to that change.  I am ok with that.

Since the return value which always is 0 is meaningless, I would prefer
to make this change.

-- 
Thanks,
Lu

>
>Thanks,
>zhong jiang
>
>
>



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-08-04 16:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2018-08-04 13:19   ` zhong jiang
2018-08-04 16:35     ` Lu Fengqi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox