In mas_empty_area(), after mas_awalk() returns, if EBUSY is not set, then mas->offset must be valid, no need to check. Same in mas_empty_area_rev(), so delete it. Signed-off-by: Peng Zhang <zhangpeng.00@xxxxxxxxxxxxx> --- lib/maple_tree.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 8bfa837b7b752..964214de2ed18 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -5305,13 +5305,9 @@ int mas_empty_area(struct ma_state *mas, unsigned long min, return xa_err(mas->node); offset = mas->offset; - if (unlikely(offset == MAPLE_NODE_SLOTS)) - return -EBUSY; - mt = mte_node_type(mas->node); pivots = ma_pivots(mas_mn(mas), mt); mas->index = max(mas->index, mas_safe_min(mas, pivots, offset)); - mas->last = mas->index + size - 1; return 0; } @@ -5365,9 +5361,6 @@ int mas_empty_area_rev(struct ma_state *mas, unsigned long min, if (mas_is_err(mas)) return xa_err(mas->node); - if (unlikely(mas->offset == MAPLE_NODE_SLOTS)) - return -EBUSY; - /* Trim the upper limit to the max. */ if (max < mas->last) mas->last = max; -- 2.20.1