diff options
author | Wei Yang <richard.weiyang@gmail.com> | 2024-09-13 06:31:28 +0000 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2024-11-06 20:11:13 -0800 |
commit | 0cc8d68abe2fdcb7039ece95f784698c0b0dc51e (patch) | |
tree | 60d085a3b921ba09b0d481fda0a79740c6bf70d5 /lib/maple_tree.c | |
parent | 0f85eb3395c74d7cc823169bbacc670c6645ae80 (diff) |
maple_tree: root node could be handled by !p_slot too
For a root node, mte_parent_slot() return 0, this exactly fits the
following !p_slot check.
So we can remove the special handling for root node.
Link: https://lkml.kernel.org/r/20240913063128.27391-1-richard.weiyang@gmail.com
Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
Reviewed-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'lib/maple_tree.c')
-rw-r--r-- | lib/maple_tree.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/maple_tree.c b/lib/maple_tree.c index cdac15168405..c2d3c8d27358 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -2155,9 +2155,7 @@ static inline bool mas_prev_sibling(struct ma_state *mas) { unsigned int p_slot = mte_parent_slot(mas->node); - if (mte_is_root(mas->node)) - return false; - + /* For root node, p_slot is set to 0 by mte_parent_slot(). */ if (!p_slot) return false; |