[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <qzqzj2qhiavjaklwscit3vjmxozbigq7bpgglwejfjpx6vlwjl@y44d47g37x4b>
Date: Tue, 24 Jun 2025 11:36:47 -0400
From: "Liam R. Howlett" <Liam.Howlett@...cle.com>
To: Dev Jain <dev.jain@....com>
Cc: akpm@...ux-foundation.org, richard.weiyang@...il.com,
maple-tree@...ts.infradead.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] maple tree: Use goto label to simplify code
* Dev Jain <dev.jain@....com> [250624 04:08]:
> Use the underflow goto label to set the status to ma_underflow and return
> NULL, as is being done elsewhere.
Thanks for this, but the stacking of labels is unpleasant to read.
A new line like I've added makes it a bit better. It's more my fault
having the existing code as it is.
>
> Signed-off-by: Dev Jain <dev.jain@....com>
> ---
> lib/maple_tree.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/lib/maple_tree.c b/lib/maple_tree.c
> index 00524e55a21e..25cf2bc607ca 100644
> --- a/lib/maple_tree.c
> +++ b/lib/maple_tree.c
> @@ -4565,11 +4565,8 @@ static void *mas_prev_slot(struct ma_state *mas, unsigned long min, bool empty)
> return entry;
>
> if (!empty) {
> - if (mas->index <= min) {
> - mas->status = ma_underflow;
> - return NULL;
> - }
> -
> + if (mas->index <= min)
> + goto underflow;
> goto again;
> }
Andrew, can you just add a new line like I have above?
Reviewed-by: Liam R. Howlett <Liam.Howlett@...cle.com>
Thanks,
Liam
Powered by blists - more mailing lists