Commit 84fd3e1e authored by Vernon Yang's avatar Vernon Yang Committed by Andrew Morton

maple_tree: use macro MA_ROOT_PARENT instead of number

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.comSigned-off-by: default avatarVernon Yang <vernon2gm@gmail.com>
Reviewed-by: default avatarLiam R. Howlett <Liam.Howlett@oracle.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent bd592703
...@@ -503,8 +503,7 @@ static inline unsigned int mte_parent_slot(const struct maple_enode *enode) ...@@ -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; unsigned long val = (unsigned long)mte_to_node(enode)->parent;
/* Root. */ if (val & MA_ROOT_PARENT)
if (val & 1)
return 0; return 0;
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment