2023-10-27 08:50:42

by Jiapeng Chong

[permalink] [raw]
Subject: [PATCH] maple_tree: Remove unused function

The function are defined in the maple_tree.c file, but not called
elsewhere, so delete the unused function.

lib/maple_tree.c:689:29: warning: unused function 'mas_pivot'.

Reported-by: Abaci Robot <[email protected]>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7064
Signed-off-by: Jiapeng Chong <[email protected]>
---
lib/maple_tree.c | 29 -----------------------------
1 file changed, 29 deletions(-)

diff --git a/lib/maple_tree.c b/lib/maple_tree.c
index bb24d84a4922..cf889aaa0011 100644
--- a/lib/maple_tree.c
+++ b/lib/maple_tree.c
@@ -679,35 +679,6 @@ static inline unsigned long *ma_gaps(struct maple_node *node,
return NULL;
}

-/*
- * mas_pivot() - Get the pivot at @piv of the maple encoded node.
- * @mas: The maple state.
- * @piv: The pivot.
- *
- * Return: the pivot at @piv of @mn.
- */
-static inline unsigned long mas_pivot(struct ma_state *mas, unsigned char piv)
-{
- struct maple_node *node = mas_mn(mas);
- enum maple_type type = mte_node_type(mas->node);
-
- if (MAS_WARN_ON(mas, piv >= mt_pivots[type])) {
- mas_set_err(mas, -EIO);
- return 0;
- }
-
- switch (type) {
- case maple_arange_64:
- return node->ma64.pivot[piv];
- case maple_range_64:
- case maple_leaf_64:
- return node->mr64.pivot[piv];
- case maple_dense:
- return 0;
- }
- return 0;
-}
-
/*
* mas_safe_pivot() - get the pivot at @piv or mas->max.
* @mas: The maple state
--
2.20.1.7.g153144c


2023-10-27 09:34:02

by David Hildenbrand

[permalink] [raw]
Subject: Re: [PATCH] maple_tree: Remove unused function

On 27.10.23 10:49, Jiapeng Chong wrote:
> The function are defined in the maple_tree.c file, but not called
> elsewhere, so delete the unused function.
>
> lib/maple_tree.c:689:29: warning: unused function 'mas_pivot'.
>
> Reported-by: Abaci Robot <[email protected]>
> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7064
> Signed-off-by: Jiapeng Chong <[email protected]>
> ---
> lib/maple_tree.c | 29 -----------------------------
> 1 file changed, 29 deletions(-)
>
> diff --git a/lib/maple_tree.c b/lib/maple_tree.c
> index bb24d84a4922..cf889aaa0011 100644
> --- a/lib/maple_tree.c
> +++ b/lib/maple_tree.c
> @@ -679,35 +679,6 @@ static inline unsigned long *ma_gaps(struct maple_node *node,
> return NULL;
> }
>
> -/*
> - * mas_pivot() - Get the pivot at @piv of the maple encoded node.
> - * @mas: The maple state.
> - * @piv: The pivot.
> - *
> - * Return: the pivot at @piv of @mn.
> - */
> -static inline unsigned long mas_pivot(struct ma_state *mas, unsigned char piv)
> -{
> - struct maple_node *node = mas_mn(mas);
> - enum maple_type type = mte_node_type(mas->node);
> -
> - if (MAS_WARN_ON(mas, piv >= mt_pivots[type])) {
> - mas_set_err(mas, -EIO);
> - return 0;
> - }
> -
> - switch (type) {
> - case maple_arange_64:
> - return node->ma64.pivot[piv];
> - case maple_range_64:
> - case maple_leaf_64:
> - return node->mr64.pivot[piv];
> - case maple_dense:
> - return 0;
> - }
> - return 0;
> -}
> -
> /*
> * mas_safe_pivot() - get the pivot at @piv or mas->max.
> * @mas: The maple state

Think the last user was removed with c2aa6f5328b9 ("maple_tree: drop
mas_{rev_}alloc() and mas_fill_gap()").

Acked-by: David Hildenbrand <[email protected]>


--
Cheers,

David / dhildenb

2023-10-27 14:22:26

by Liam R. Howlett

[permalink] [raw]
Subject: Re: [PATCH] maple_tree: Remove unused function

* Jiapeng Chong <[email protected]> [231027 04:50]:
> The function are defined in the maple_tree.c file, but not called
> elsewhere, so delete the unused function.
>
> lib/maple_tree.c:689:29: warning: unused function 'mas_pivot'.
>
> Reported-by: Abaci Robot <[email protected]>
> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7064
> Signed-off-by: Jiapeng Chong <[email protected]>

Thanks, this has fallen out of use and isn't used in the testing code
either.

Reviewed-by: Liam R. Howlett <[email protected]>

> ---
> lib/maple_tree.c | 29 -----------------------------
> 1 file changed, 29 deletions(-)
>
> diff --git a/lib/maple_tree.c b/lib/maple_tree.c
> index bb24d84a4922..cf889aaa0011 100644
> --- a/lib/maple_tree.c
> +++ b/lib/maple_tree.c
> @@ -679,35 +679,6 @@ static inline unsigned long *ma_gaps(struct maple_node *node,
> return NULL;
> }
>
> -/*
> - * mas_pivot() - Get the pivot at @piv of the maple encoded node.
> - * @mas: The maple state.
> - * @piv: The pivot.
> - *
> - * Return: the pivot at @piv of @mn.
> - */
> -static inline unsigned long mas_pivot(struct ma_state *mas, unsigned char piv)
> -{
> - struct maple_node *node = mas_mn(mas);
> - enum maple_type type = mte_node_type(mas->node);
> -
> - if (MAS_WARN_ON(mas, piv >= mt_pivots[type])) {
> - mas_set_err(mas, -EIO);
> - return 0;
> - }
> -
> - switch (type) {
> - case maple_arange_64:
> - return node->ma64.pivot[piv];
> - case maple_range_64:
> - case maple_leaf_64:
> - return node->mr64.pivot[piv];
> - case maple_dense:
> - return 0;
> - }
> - return 0;
> -}
> -
> /*
> * mas_safe_pivot() - get the pivot at @piv or mas->max.
> * @mas: The maple state
> --
> 2.20.1.7.g153144c
>