From 941f369ae7a15570cb5336c738a01517821f3a9f Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett" Date: Wed, 20 May 2020 13:22:16 -0400 Subject: [PATCH] maple_tree: Remove mt_is_advanced in favor of xa_is_advanced. The two functions are now the same so just use the xa_ version. Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index bd9ff56933c3..e2707cc6610b 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -153,11 +153,6 @@ static inline bool mt_is_reserved(const void *entry) return ((unsigned long)entry < 4096) && xa_is_internal(entry); } -static inline bool mt_is_advanced(const void *entry) -{ - return xa_is_internal(entry) && (entry < XA_ZERO_ENTRY); -} - static inline bool mt_is_empty(const void *entry) { return (!entry) || xa_is_deleted(entry) || xa_is_skip(entry); @@ -949,7 +944,7 @@ static inline void mas_shift_pivot(struct ma_state *curr, if (!leaf) { if (mt_is_alloc(left.tree)) mte_set_gap(left.node, slot, 0); - if (!mt_is_advanced(entry)) + if (!xa_is_advanced(entry)) mte_free(entry); // Destroy not needed. } } while (--slot > l_p_slot); @@ -964,7 +959,7 @@ static inline void mas_shift_pivot(struct ma_state *curr, if (!leaf ) { if (mt_is_alloc(right.tree)) mte_set_gap(right.node, r_p_slot, 0); - if (!mt_is_advanced(entry)) + if (!xa_is_advanced(entry)) mte_free(entry); } } @@ -985,7 +980,7 @@ static inline void mas_shift_pivot(struct ma_state *curr, if (!leaf ) { if (mt_is_alloc(left.tree)) mte_set_gap(left.node, l_p_slot, 0); - if (!mt_is_advanced(entry)) + if (!xa_is_advanced(entry)) mte_free(entry); } @@ -5312,7 +5307,7 @@ int mtree_store_range(struct maple_tree *mt, unsigned long index, { MA_STATE(mas, mt, index, last); - if (WARN_ON_ONCE(mt_is_advanced(entry))) + if (WARN_ON_ONCE(xa_is_advanced(entry))) return -EINVAL; if (index > last) @@ -5344,7 +5339,7 @@ int mtree_insert_range(struct maple_tree *mt, unsigned long first, { MA_STATE(ms, mt, first, last); - if (WARN_ON_ONCE(mt_is_advanced(entry))) + if (WARN_ON_ONCE(xa_is_advanced(entry))) return -EINVAL; if (first > last) -- 2.50.1