summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorVernon Yang <vernon2gm@gmail.com>2022-12-21 07:00:55 +0100
committerAndrew Morton <akpm@linux-foundation.org>2023-01-19 02:12:46 +0100
commit84fd3e1ee395649ac45b7317d44c10b33d0dca79 (patch)
treede8ba3ac1127ef8ccdab3cd9ebea9b50b9ffa7ad /lib
parentmaple_tree: use mt_node_max() instead of direct operations mt_max[] (diff)
downloadlinux-84fd3e1ee395649ac45b7317d44c10b33d0dca79.tar.xz
linux-84fd3e1ee395649ac45b7317d44c10b33d0dca79.zip
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.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>
Diffstat (limited to 'lib')
-rw-r--r--lib/maple_tree.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/maple_tree.c b/lib/maple_tree.c
index 506b8fdb5f1b..4b0575b60a11 100644
--- a/lib/maple_tree.c
+++ b/lib/maple_tree.c
@@ -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;
/*