Skip to contentSkip to conversation

mpale_tree: remove redundant check on mas_wr_append.

PATCH In review Levi Yun 2 participants 2 messages Nov 11, 2023 – Nov 12, 2023

Subsystems (3)
lore
Share & tools
lore

Levi Yun

author
#0 lore raw

PATCH 1/1 mpale_tree: remove redundant check on mas_wr_append.

Checking data appending on node is done by

    mas->offsest == end
which is identical with:
    mas->offset == wr_mas->node_end

Remove redundant check and there shouldn't be functional change.

---
 lib/maple_tree.c | 3 ---
 1 file changed, 3 deletions(-)
lib/maple_tree.c +0 -3
index bb24d84a4922..d16b8e211174 100644
@@ -4141,9 +4141,6 @@ static inline bool mas_wr_append(struct ma_wr_state *wr_mas,
 	if (mt_in_rcu(mas->tree))
 		return false;
 
-	if (mas->offset != wr_mas->node_end)
-		return false;
-
 	end = wr_mas->node_end;
 	if (mas->offset != end)
 		return false;
Signature · 1 line
2.41.0
#1 lore raw
Quoted 6 lines · Levi Yun

Checking data appending on node is done by

    mas->offsest == end
which is identical with:
    mas->offset == wr_mas->node_end

Remove redundant check and there shouldn't be functional change.

This was already sent out by Peng.

See http://lists.infradead.org/pipermail/maple-tree/2023-November/003051.html

Thanks,
Liam

Quoted 23 lines
---
 lib/maple_tree.c | 3 ---
 1 file changed, 3 deletions(-)
lib/maple_tree.c +0 -3
index bb24d84a4922..d16b8e211174 100644
@@ -4141,9 +4141,6 @@ static inline bool mas_wr_append(struct ma_wr_state *wr_mas,
 	if (mt_in_rcu(mas->tree))
 		return false;
 
-	if (mas->offset != wr_mas->node_end)
-		return false;
-
 	end = wr_mas->node_end;
 	if (mas->offset != end)
 		return false;
Signature · 1 line
2.41.0