From: Liam R. Howlett Date: Tue, 5 Feb 2019 15:23:16 +0000 (-0500) Subject: maple_tree: remove duplicate function. X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=167e9bece9dadd092bbb312f531b743a2ae33016;p=users%2Fjedix%2Flinux-maple.git 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 --- diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 83d98d53d534f..bf062e01f4cdd 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)