Skip to content

Commit

Permalink
maple_tree: use macro MA_ROOT_PARENT instead of number
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Vernon Yang authored and Andrew Morton committed Jan 19, 2023
1 parent bd59270 commit 84fd3e1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/maple_tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/*
Expand Down

0 comments on commit 84fd3e1

Please sign in to comment.