linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Dev Jain <dev.jain@arm.com>
To: akpm@linux-foundation.org, Liam.Howlett@oracle.com
Cc: richard.weiyang@gmail.com, maple-tree@lists.infradead.org,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Dev Jain <dev.jain@arm.com>
Subject: [PATCH] maple tree: Use goto label to simplify code
Date: Tue, 24 Jun 2025 13:37:48 +0530	[thread overview]
Message-ID: <20250624080748.4855-1-dev.jain@arm.com> (raw)

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

Signed-off-by: Dev Jain <dev.jain@arm.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;
 	}
 
-- 
2.30.2



             reply	other threads:[~2025-06-24  8:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-24  8:07 Dev Jain [this message]
2025-06-24 15:36 ` [PATCH] maple tree: Use goto label to simplify code Liam R. Howlett
2025-06-25  7:56 ` Wei Yang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250624080748.4855-1-dev.jain@arm.com \
    --to=dev.jain@arm.com \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=maple-tree@lists.infradead.org \
    --cc=richard.weiyang@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).