linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Vernon Yang <vernon2gm@gmail.com>
To: Liam.Howlett@oracle.com, akpm@linux-foundation.org
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	maple-tree@lists.infradead.org, Vernon Yang <vernon2gm@gmail.com>
Subject: [PATCH v2 3/7] maple_tree: use mt_node_max() instead of direct operations mt_max[]
Date: Wed, 21 Dec 2022 14:00:54 +0800	[thread overview]
Message-ID: <20221221060058.609003-4-vernon2gm@gmail.com> (raw)
In-Reply-To: <20221221060058.609003-1-vernon2gm@gmail.com>

Use mt_node_max() to get the maximum number of slots for a node,
rather than direct operations mt_max[], makes it better portability.

Reviewed-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Signed-off-by: Vernon Yang <vernon2gm@gmail.com>
---
 lib/maple_tree.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/maple_tree.c b/lib/maple_tree.c
index 34aa93c85d6e..3d45c515ed42 100644
--- a/lib/maple_tree.c
+++ b/lib/maple_tree.c
@@ -6723,7 +6723,7 @@ static void mt_dump_range64(const struct maple_tree *mt, void *entry,
 
 		if (i < (MAPLE_RANGE64_SLOTS - 1))
 			last = node->pivot[i];
-		else if (!node->slot[i] && max != mt_max[mte_node_type(entry)])
+		else if (!node->slot[i] && max != mt_node_max(entry))
 			break;
 		if (last == 0 && i > 0)
 			break;
@@ -6830,7 +6830,7 @@ void mt_dump(const struct maple_tree *mt)
 	if (!xa_is_node(entry))
 		mt_dump_entry(entry, 0, 0, 0);
 	else if (entry)
-		mt_dump_node(mt, entry, 0, mt_max[mte_node_type(entry)], 0);
+		mt_dump_node(mt, entry, 0, mt_node_max(entry), 0);
 }
 EXPORT_SYMBOL_GPL(mt_dump);
 
-- 
2.34.1



  parent reply	other threads:[~2022-12-21  6:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-21  6:00 [PATCH v2 0/7] Clean up and refinement for maple tree Vernon Yang
2022-12-21  6:00 ` [PATCH v2 1/7] maple_tree: remove extra space and blank line Vernon Yang
2022-12-21  6:00 ` [PATCH v2 2/7] maple_tree: remove extra return statement Vernon Yang
2022-12-21  6:00 ` Vernon Yang [this message]
2022-12-21  6:00 ` [PATCH v2 4/7] maple_tree: use macro MA_ROOT_PARENT instead of number Vernon Yang
2022-12-21  6:00 ` [PATCH v2 5/7] maple_tree: remove the redundant code Vernon Yang
2022-12-21  6:00 ` [PATCH v2 6/7] maple_tree: refine ma_state init from mas_start() Vernon Yang
2022-12-21  6:00 ` [PATCH v2 7/7] maple_tree: refine mab_calc_split function Vernon Yang
2022-12-21 18:53 ` [PATCH v2 0/7] Clean up and refinement for maple tree Liam Howlett

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=20221221060058.609003-4-vernon2gm@gmail.com \
    --to=vernon2gm@gmail.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 \
    /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