lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230425140955.3834476-31-Liam.Howlett@oracle.com>
Date:   Tue, 25 Apr 2023 10:09:51 -0400
From:   "Liam R. Howlett" <Liam.Howlett@...cle.com>
To:     Andrew Morton <akpm@...ux-foundation.org>
Cc:     linux-kernel@...r.kernel.org, linux-mm@...ck.org,
        maple-tree@...ts.infradead.org,
        "Liam R. Howlett" <Liam.Howlett@...cle.com>
Subject: [PATCH 30/34] maple_tree: Fix comments for mas_next_entry() and mas_prev_entry()

Signed-off-by: Liam R. Howlett <Liam.Howlett@...cle.com>
---
 lib/maple_tree.c | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/lib/maple_tree.c b/lib/maple_tree.c
index 297d936321347..377b57bbe6b9b 100644
--- a/lib/maple_tree.c
+++ b/lib/maple_tree.c
@@ -4814,7 +4814,7 @@ void *mas_next_slot(struct ma_state *mas, unsigned long max)
  *
  * Set the @mas->node to the next entry and the range_start to
  * the beginning value for the entry.  Does not check beyond @limit.
- * Sets @mas->index and @mas->last to the limit if it is hit.
+ * Sets @mas->index and @mas->last to the limit if it is within the limit.
  * Restarts on dead nodes.
  *
  * Return: the next entry or %NULL.
@@ -4836,21 +4836,33 @@ static inline void *mas_next_entry(struct ma_state *mas, unsigned long limit)
 	return mas_next_slot(mas, limit);
 }
 
-static inline void *mas_prev_entry(struct ma_state *mas, unsigned long min)
+/*
+ * mas_prev_entry() - Internal function to get the previous entry.
+ * @mas: The maple state
+ * @limit: The minimum range start.
+ *
+ * Set the @mas->node to the previous entry and the range_start to
+ * the beginning value for the entry.  Does not check beyond @limit.
+ * Sets @mas->index and @mas->last to the limit if it is within the limit.
+ * Restarts on dead nodes.
+ *
+ * Return: the next entry or %NULL.
+ */
+static inline void *mas_prev_entry(struct ma_state *mas, unsigned long limit)
 {
 	void *entry;
 
-	if (mas->index < min)
+	if (mas->index < limit)
 		return NULL;
 
-	entry = mas_prev_slot(mas, min);
+	entry = mas_prev_slot(mas, limit);
 	if (entry)
 		return entry;
 
 	if (mas_is_none(mas))
 		return NULL;
 
-	return mas_prev_slot(mas, min);
+	return mas_prev_slot(mas, limit);
 }
 
 /*
-- 
2.39.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ