Skip to contentSkip to conversation

maple_tree: change return type of mas_split_final_node as void.

PATCH Applied Levi Yun 2 participants 2 messages Nov 9, 2023 – Nov 10, 2023

Subsystems (3)
lore
Share & tools
lore

Levi Yun

author
#0 lore raw

PATCH 1/1 maple_tree: change return type of mas_split_final_node as void.

mas_split_final_node always returns true and there is no usage for checking return value.

change return type as void.

---
 lib/maple_tree.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
lib/maple_tree.c +1 -2
index bb24d84a4922..9389a631483a 100644
@@ -3167,7 +3167,7 @@ static inline void mas_destroy_rebalance(struct ma_state *mas, unsigned char end
  * @mas: The maple state
  * @height: The height of the tree in case it's a new root.
  */
-static inline bool mas_split_final_node(struct maple_subtree_state *mast,
+static inline void mas_split_final_node(struct maple_subtree_state *mast,
 					struct ma_state *mas, int height)
 {
 	struct maple_enode *ancestor;
@@ -3191,7 +3191,6 @@ static inline bool mas_split_final_node(struct maple_subtree_state *mast,
 	mast->l->node = ancestor;
 	mab_mas_cp(mast->bn, 0, mt_slots[mast->bn->type] - 1, mast->l, true);
 	mas->offset = mast->bn->b_end - 1;
-	return true;
 }
 
 /*

--
2.39.2

Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Levi Yun

mas_split_final_node always returns true and there is no usage for checking return value.

change return type as void.

Thanks for the patch.

Quoted 2 lines
Quoted 27 lines
---
 lib/maple_tree.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
lib/maple_tree.c +1 -3
index bb24d84a4922..9389a631483a 100644
@@ -3167,7 +3167,7 @@ static inline void mas_destroy_rebalance(struct ma_state *mas, unsigned char end
  * @mas: The maple state
  * @height: The height of the tree in case it's a new root.
  */
-static inline bool mas_split_final_node(struct maple_subtree_state *mast,
+static inline void mas_split_final_node(struct maple_subtree_state *mast,
 					struct ma_state *mas, int height)
 {
 	struct maple_enode *ancestor;
@@ -3191,7 +3191,6 @@ static inline bool mas_split_final_node(struct maple_subtree_state *mast,
 	mast->l->node = ancestor;
 	mab_mas_cp(mast->bn, 0, mt_slots[mast->bn->type] - 1, mast->l, true);
 	mas->offset = mast->bn->b_end - 1;
-	return true;
 }
 
 /*
--

2.39.2