Skip to content

Commit 8c836f1

Browse files
RichardWeiYangakpm00
authored andcommitted
maple_tree: not necessary to check index/last again
Before calling mas_new_root(), the range has been checked. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Wei Yang <[email protected]> Reviewed-by: Liam R. Howlett <[email protected]> Cc: Liam R. Howlett <[email protected]> Cc: Sidhartha Kumar <[email protected]> Cc: Lorenzo Stoakes <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent cefbcf2 commit 8c836f1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/maple_tree.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3670,7 +3670,9 @@ static inline void mas_new_root(struct ma_state *mas, void *entry)
36703670
void __rcu **slots;
36713671
unsigned long *pivots;
36723672

3673-
if (!entry && !mas->index && mas->last == ULONG_MAX) {
3673+
WARN_ON_ONCE(mas->index || mas->last != ULONG_MAX);
3674+
3675+
if (!entry) {
36743676
mas->depth = 0;
36753677
mas_set_height(mas);
36763678
rcu_assign_pointer(mas->tree->ma_root, entry);

0 commit comments

Comments
 (0)