Skip to content

Commit

Permalink
maple_tree: remove pointer to pointer use in mas_alloc_nodes()
Browse files Browse the repository at this point in the history
There is a more direct and cleaner way of implementing the same functional
code.  Remove the confusing and unnecessary use of pointers here.

Link: https://lkml.kernel.org/r/20221026151241.4031117-1-Liam.Howlett@oracle.com
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Suggested-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
  • Loading branch information
Liam Howlett authored and Andrew Morton committed Nov 8, 2022
1 parent f0c4d9f commit c61b3a2
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/maple_tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -1209,7 +1209,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);
Expand Down Expand Up @@ -1263,8 +1262,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;
Expand Down

0 comments on commit c61b3a2

Please sign in to comment.