From: Dev Jain Date: Tue, 24 Jun 2025 08:07:48 +0000 (+0530) Subject: maple tree: use goto label to simplify code X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=592b939b59b43a817ce6d79900793982d452bb5d;p=thirdparty%2Flinux.git 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 Reviewed-by: Liam R. Howlett Reviewed-by: Wei Yang Signed-off-by: Andrew Morton --- diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 00524e55a21e0..34b84b14985ea 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -4560,15 +4560,12 @@ again: if (unlikely(mas_rewalk_if_dead(mas, node, save_point))) goto retry; - if (likely(entry)) return entry; if (!empty) { - if (mas->index <= min) { - mas->status = ma_underflow; - return NULL; - } + if (mas->index <= min) + goto underflow; goto again; }