From: Liam Howlett Date: Wed, 26 Oct 2022 15:13:29 +0000 (+0000) Subject: maple_tree: remove pointer to pointer use in mas_alloc_nodes() X-Git-Tag: v6.1-rc5~6^2~21 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c61b3a2b2d9bb36698f8c2f65aa41ba183815264;p=platform%2Fkernel%2Flinux-starfive.git 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. Link: https://lkml.kernel.org/r/20221026151241.4031117-1-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Suggested-by: Lukas Bulwahn Signed-off-by: Andrew Morton --- diff --git a/lib/maple_tree.c b/lib/maple_tree.c index fbde494..72e3b6a 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -1209,7 +1209,6 @@ done: 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); @@ -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;