linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/vmalloc.c: Fix "unused function" warning
@ 2022-01-29  3:46 Jiapeng Chong
  2022-02-01  8:30 ` Uladzislau Rezki
  0 siblings, 1 reply; 2+ messages in thread
From: Jiapeng Chong @ 2022-01-29  3:46 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm, linux-kernel, Jiapeng Chong, Abaci Robot

compute_subtree_max_size() is unused, when building with
DEBUG_AUGMENT_PROPAGATE_CHECK=y.

mm/vmalloc.c:785:1: warning: unused function 'compute_subtree_max_size'
[-Wunused-function].

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 mm/vmalloc.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index 028ce2b9bbf9..42d37b4bd351 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -778,17 +778,6 @@ get_subtree_max_size(struct rb_node *node)
 	return va ? va->subtree_max_size : 0;
 }
 
-/*
- * Gets called when remove the node and rotate.
- */
-static __always_inline unsigned long
-compute_subtree_max_size(struct vmap_area *va)
-{
-	return max3(va_size(va),
-		get_subtree_max_size(va->rb_node.rb_left),
-		get_subtree_max_size(va->rb_node.rb_right));
-}
-
 RB_DECLARE_CALLBACKS_MAX(static, free_vmap_area_rb_augment_cb,
 	struct vmap_area, rb_node, unsigned long, subtree_max_size, va_size)
 
@@ -978,6 +967,17 @@ unlink_va(struct vmap_area *va, struct rb_root *root)
 }
 
 #if DEBUG_AUGMENT_PROPAGATE_CHECK
+/*
+ * Gets called when remove the node and rotate.
+ */
+static __always_inline unsigned long
+compute_subtree_max_size(struct vmap_area *va)
+{
+	return max3(va_size(va),
+		get_subtree_max_size(va->rb_node.rb_left),
+		get_subtree_max_size(va->rb_node.rb_right));
+}
+
 static void
 augment_tree_propagate_check(void)
 {
-- 
2.20.1.7.g153144c



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

* Re: [PATCH] mm/vmalloc.c: Fix "unused function" warning
  2022-01-29  3:46 [PATCH] mm/vmalloc.c: Fix "unused function" warning Jiapeng Chong
@ 2022-02-01  8:30 ` Uladzislau Rezki
  0 siblings, 0 replies; 2+ messages in thread
From: Uladzislau Rezki @ 2022-02-01  8:30 UTC (permalink / raw)
  To: Jiapeng Chong; +Cc: akpm, linux-mm, linux-kernel, Abaci Robot

> compute_subtree_max_size() is unused, when building with
> DEBUG_AUGMENT_PROPAGATE_CHECK=y.
> 
Nit: vice versa? It is only used when DEBUG_AUGMENT_PROPAGATE_CHECK=y

> mm/vmalloc.c:785:1: warning: unused function 'compute_subtree_max_size'
> [-Wunused-function].
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> ---
>  mm/vmalloc.c | 22 +++++++++++-----------
>  1 file changed, 11 insertions(+), 11 deletions(-)
> 
> diff --git a/mm/vmalloc.c b/mm/vmalloc.c
> index 028ce2b9bbf9..42d37b4bd351 100644
> --- a/mm/vmalloc.c
> +++ b/mm/vmalloc.c
> @@ -778,17 +778,6 @@ get_subtree_max_size(struct rb_node *node)
>  	return va ? va->subtree_max_size : 0;
>  }
>  
> -/*
> - * Gets called when remove the node and rotate.
> - */
> -static __always_inline unsigned long
> -compute_subtree_max_size(struct vmap_area *va)
> -{
> -	return max3(va_size(va),
> -		get_subtree_max_size(va->rb_node.rb_left),
> -		get_subtree_max_size(va->rb_node.rb_right));
> -}
> -
>  RB_DECLARE_CALLBACKS_MAX(static, free_vmap_area_rb_augment_cb,
>  	struct vmap_area, rb_node, unsigned long, subtree_max_size, va_size)
>  
> @@ -978,6 +967,17 @@ unlink_va(struct vmap_area *va, struct rb_root *root)
>  }
>  
>  #if DEBUG_AUGMENT_PROPAGATE_CHECK
> +/*
> + * Gets called when remove the node and rotate.
> + */
> +static __always_inline unsigned long
> +compute_subtree_max_size(struct vmap_area *va)
> +{
> +	return max3(va_size(va),
> +		get_subtree_max_size(va->rb_node.rb_left),
> +		get_subtree_max_size(va->rb_node.rb_right));
> +}
> +
>  static void
>  augment_tree_propagate_check(void)
>  {
> -- 
> 2.20.1.7.g153144c
> 
Reviewed-by: Uladzislau Rezki (Sony) <urezki@gmail.com>

--
Vlad Rezki


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

end of thread, other threads:[~2022-02-01  8:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-29  3:46 [PATCH] mm/vmalloc.c: Fix "unused function" warning Jiapeng Chong
2022-02-01  8:30 ` Uladzislau Rezki

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