Skip to contentSkip to conversation

maple_tree: Remove pointer to pointer use in mas_alloc_nodes()

PATCH Applied Liam Howlett 1 participant 1 message Oct 26, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 maple_tree: Remove pointer to pointer use in mas_alloc_nodes()

There is a more direct and cleaner way of implementing the same functional code. Remove the confusing and unnecessary use of pointers here.

---
 lib/maple_tree.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
lib/maple_tree.c +1 -3
index cbae5b1c1a62..6f3945654baf 100644
@@ -1205,7 +1205,6 @@ static inline void mas_push_node(struct ma_state *mas, struct maple_node *used)
 static inline void mas_alloc_nodes(struct ma_state *mas, gfp_t gfp)
 {
 	struct maple_alloc *node;
-	struct maple_alloc **nodep = &mas->alloc;
 	unsigned long allocated = mas_allocated(mas);
 	unsigned long success = allocated;
 	unsigned int requested = mas_alloc_req(mas);
@@ -1259,8 +1258,7 @@ static inline void mas_alloc_nodes(struct ma_state *mas, gfp_t gfp)
 			node->node_count--;
 
 		success += count;
-		nodep = &node->slot[0];
-		node = *nodep;
+		node = node->slot[0];
 		requested -= count;
 	}
 	mas->alloc->total = success;
Signature · 1 line
2.35.1