From 7df36a70bb34d21a84ddc0dfab2e87a1497bc999 Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett" Date: Tue, 5 Feb 2019 10:23:16 -0500 Subject: [PATCH] maple_tree: remove duplicate function. When adding a check for reserved entries, I hadn't noticed it already existed. Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 83d98d53d534..bf062e01f4cd 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -47,6 +47,10 @@ static inline enum maple_type mt_node_hole(const void *entry) return (unsigned long)entry & 4; } +/* Private + * We also reserve values with the bottom two bits set to '10' which are + * below 4096 + */ static inline bool mt_is_reserved(const void *entry) { return ((unsigned long)entry < 4096) && xa_is_internal(entry); @@ -927,20 +931,6 @@ bool _mas_walk(struct ma_state *mas) return true; } -/* Private - * We also reserve values with the bottom two bits set to '10' which are - * below 4096 - */ -bool ma_reserved(void *entry) -{ - unsigned long ul_entry = (unsigned long)entry; - - if ((ul_entry < 4096) && ((ul_entry & 3) == 2)) - return true; - - return false; -} - void ma_insert(struct ma_state *mas, void *entry) { unsigned char slot = MAPLE_NODE_SLOTS; @@ -1128,7 +1118,7 @@ int mtree_insert_range(struct maple_tree *mt, unsigned long first, MA_STATE(ms, mt, first, last); - if (WARN_ON_ONCE(ma_reserved(entry))) + if (WARN_ON_ONCE(mt_is_reserved(entry))) return -EINVAL; if (first > last) -- 2.50.1