diff mbox series

[4/4] maple_tree: now we are sure mas_end wouldn't exceed mt_pivots[mt]

Message ID 20240919234832.24237-5-richard.weiyang@gmail.com (mailing list archive)
State New
Headers show
Series refine mas_end of mas_mab_cp() | expand

Commit Message

Wei Yang Sept. 19, 2024, 11:48 p.m. UTC
Now all the cases of mas_mab_cp() is called with mas_end at most equals
mt_pivots[mt]. So we can get piv_end == mas_end.

Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
---
 lib/maple_tree.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/lib/maple_tree.c b/lib/maple_tree.c
index bb4183b973d4..ef9aba07adbd 100644
--- a/lib/maple_tree.c
+++ b/lib/maple_tree.c
@@ -1907,11 +1907,11 @@  static inline void mas_mab_cp(struct ma_state *mas, unsigned char mas_start,
 	void __rcu **slots;
 	unsigned long *pivots, *gaps;
 	int i = mas_start, j = mab_start;
-	unsigned char piv_end;
 
 	node = mas_mn(mas);
 	mt = mte_node_type(mas->node);
 	pivots = ma_pivots(node, mt);
+
 	if (!i) {
 		b_node->pivot[j] = pivots[i++];
 		if (unlikely(i > mas_end))
@@ -1919,8 +1919,7 @@  static inline void mas_mab_cp(struct ma_state *mas, unsigned char mas_start,
 		j++;
 	}
 
-	piv_end = min(mas_end, mt_pivots[mt]);
-	for (; i < piv_end; i++, j++) {
+	for (; i < mas_end; i++, j++) {
 		b_node->pivot[j] = pivots[i];
 		if (unlikely(!b_node->pivot[j]))
 			goto complete;