Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

maple tree: use goto label to simplify code

Use the underflow goto label to set the status to ma_underflow and return
NULL, as is being done elsewhere.

[akpm@linux-foundation.org: add newline, per Liam (and remove one, per akpm)]
Link: https://lkml.kernel.org/r/20250624080748.4855-1-dev.jain@arm.com
Signed-off-by: Dev Jain <dev.jain@arm.com>
Reviewed-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Reviewed-by: Wei Yang <richard.weiyang@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Dev Jain and committed by
Andrew Morton
592b939b dfa3cf0b

+2 -5
+2 -5
lib/maple_tree.c
··· 4560 4560 if (unlikely(mas_rewalk_if_dead(mas, node, save_point))) 4561 4561 goto retry; 4562 4562 4563 - 4564 4563 if (likely(entry)) 4565 4564 return entry; 4566 4565 4567 4566 if (!empty) { 4568 - if (mas->index <= min) { 4569 - mas->status = ma_underflow; 4570 - return NULL; 4571 - } 4567 + if (mas->index <= min) 4568 + goto underflow; 4572 4569 4573 4570 goto again; 4574 4571 }