]> www.infradead.org Git - users/jedix/linux-maple.git/commit
maple_tree: simplify mas_push_node()
authorWei Yang <richard.weiyang@gmail.com>
Tue, 15 Oct 2024 12:07:46 +0000 (12:07 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 1 Nov 2024 04:29:09 +0000 (21:29 -0700)
commit697b17e0612029a714ea4a2a53cd97765242e42b
tree43589a52378956126396e948854a2fcee0295525
parent3811d51c9d7dde2774aef2867edcd4ef309b4ad0
maple_tree: simplify mas_push_node()

When count is not 0, we know head is valid.  So we can put the assignment
in if (count) instead of checking the head pointer again.

Also count represents current total, we can assign the new total by
increasing the count by one.

Link: https://lkml.kernel.org/r/20241015120746.15850-4-richard.weiyang@gmail.com
Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
Reviewed-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
Cc: Sidhartha Kumar <sidhartha.kumar@oracle.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
lib/maple_tree.c