]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
maple_tree: remove duplicate function.
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Tue, 5 Feb 2019 15:23:16 +0000 (10:23 -0500)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Wed, 31 Jul 2019 14:52:39 +0000 (10:52 -0400)
When adding a check for reserved entries, I hadn't noticed it already
existed.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
lib/maple_tree.c

index 83d98d53d534f414a957282edbe26e791b007439..bf062e01f4cddbe8bed5c7a18b7f921c5f5c8512 100644 (file)
@@ -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)