maple_tree: use macro MA_ROOT_PARENT instead of number
authorVernon Yang <vernon2gm@gmail.com>
Wed, 21 Dec 2022 06:00:55 +0000 (14:00 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 19 Jan 2023 01:12:46 +0000 (17:12 -0800)
When you need to compare whether node->parent is parent of the
root node, using macro MA_ROOT_PARENT is easier to understand
and for better readability.

Link: https://lkml.kernel.org/r/20221221060058.609003-5-vernon2gm@gmail.com
Signed-off-by: Vernon Yang <vernon2gm@gmail.com>
Reviewed-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
lib/maple_tree.c

index 506b8fd..4b0575b 100644 (file)
@@ -503,8 +503,7 @@ static inline unsigned int mte_parent_slot(const struct maple_enode *enode)
 {
        unsigned long val = (unsigned long)mte_to_node(enode)->parent;
 
-       /* Root. */
-       if (val & 1)
+       if (val & MA_ROOT_PARENT)
                return 0;
 
        /*