linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] maple_tree: fix MAPLE_PARENT_RANGE32 and parent pointer docs
@ 2025-08-26 15:13 Sidhartha Kumar
  2025-08-26 15:24 ` Liam R. Howlett
  0 siblings, 1 reply; 2+ messages in thread
From: Sidhartha Kumar @ 2025-08-26 15:13 UTC (permalink / raw)
  To: linux-kernel, maple-tree; +Cc: akpm, willy, liam.howlett, Sidhartha Kumar

MAPLE_PARENT_RANGE32 should be 0x02 as a 32 bit node is
indicated by the bit pattern 0b010 which is the hex value 0x02.
There are no users currently, so there is no associated bug with this
wrong value.

Fix typo Note -> Node and replace x with b to indicate binary
values.

Fixes: 54a611b60590 ("Maple Tree: add new data structure")
Signed-off-by: Sidhartha Kumar <sidhartha.kumar@oracle.com>
---
 include/linux/maple_tree.h | 16 ++++++++--------
 lib/maple_tree.c           | 12 ++++++------
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/include/linux/maple_tree.h b/include/linux/maple_tree.h
index bafe143b1f78..41e633264e51 100644
--- a/include/linux/maple_tree.h
+++ b/include/linux/maple_tree.h
@@ -57,17 +57,17 @@
  * MT_FLAGS_ALLOC_RANGE flag.
  *
  *  Node types:
- *   0x??1 = Root
- *   0x?00 = 16 bit nodes
- *   0x010 = 32 bit nodes
- *   0x110 = 64 bit nodes
+ *   0b??1 = Root
+ *   0b?00 = 16 bit nodes
+ *   0b010 = 32 bit nodes
+ *   0b110 = 64 bit nodes
  *
  *  Slot size and location in the parent pointer:
  *   type  : slot location
- *   0x??1 : Root
- *   0x?00 : 16 bit values, type in 0-1, slot in 2-6
- *   0x010 : 32 bit values, type in 0-2, slot in 3-6
- *   0x110 : 64 bit values, type in 0-2, slot in 3-6
+ *   0b??1 : Root
+ *   0b?00 : 16 bit values, type in 0-1, slot in 2-6
+ *   0b010 : 32 bit values, type in 0-2, slot in 3-6
+ *   0b110 : 64 bit values, type in 0-2, slot in 3-6
  */
 
 /*
diff --git a/lib/maple_tree.c b/lib/maple_tree.c
index 38fb68c08291..d1d513bb6e95 100644
--- a/lib/maple_tree.c
+++ b/lib/maple_tree.c
@@ -405,11 +405,11 @@ static __always_inline bool mt_is_alloc(struct maple_tree *mt)
  * a reuse of the last bit in the node type.  This is possible by using bit 1 to
  * indicate if bit 2 is part of the type or the slot.
  *
- * Note types:
- *  0x??1 = Root
- *  0x?00 = 16 bit nodes
- *  0x010 = 32 bit nodes
- *  0x110 = 64 bit nodes
+ * Node types:
+ *  0b??1 = Root
+ *  0b?00 = 16 bit nodes
+ *  0b010 = 32 bit nodes
+ *  0b110 = 64 bit nodes
  *
  * Slot size and alignment
  *  0b??1 : Root
@@ -427,7 +427,7 @@ static __always_inline bool mt_is_alloc(struct maple_tree *mt)
 #define MAPLE_PARENT_16B_SLOT_MASK	0xFC
 
 #define MAPLE_PARENT_RANGE64		0x06
-#define MAPLE_PARENT_RANGE32		0x04
+#define MAPLE_PARENT_RANGE32		0x02
 #define MAPLE_PARENT_NOT_RANGE16	0x02
 
 /*
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] maple_tree: fix MAPLE_PARENT_RANGE32 and parent pointer docs
  2025-08-26 15:13 [PATCH] maple_tree: fix MAPLE_PARENT_RANGE32 and parent pointer docs Sidhartha Kumar
@ 2025-08-26 15:24 ` Liam R. Howlett
  0 siblings, 0 replies; 2+ messages in thread
From: Liam R. Howlett @ 2025-08-26 15:24 UTC (permalink / raw)
  To: Sidhartha Kumar; +Cc: linux-kernel, maple-tree, akpm, willy

* Sidhartha Kumar <sidhartha.kumar@oracle.com> [250826 11:13]:
> MAPLE_PARENT_RANGE32 should be 0x02 as a 32 bit node is
> indicated by the bit pattern 0b010 which is the hex value 0x02.
> There are no users currently, so there is no associated bug with this
> wrong value.
> 
> Fix typo Note -> Node and replace x with b to indicate binary
> values.
> 
> Fixes: 54a611b60590 ("Maple Tree: add new data structure")
> Signed-off-by: Sidhartha Kumar <sidhartha.kumar@oracle.com>

Thanks!

Reviewed-by: Liam R. Howlett <Liam.Howlett@oracle.com>

> ---
>  include/linux/maple_tree.h | 16 ++++++++--------
>  lib/maple_tree.c           | 12 ++++++------
>  2 files changed, 14 insertions(+), 14 deletions(-)
> 
> diff --git a/include/linux/maple_tree.h b/include/linux/maple_tree.h
> index bafe143b1f78..41e633264e51 100644
> --- a/include/linux/maple_tree.h
> +++ b/include/linux/maple_tree.h
> @@ -57,17 +57,17 @@
>   * MT_FLAGS_ALLOC_RANGE flag.
>   *
>   *  Node types:
> - *   0x??1 = Root
> - *   0x?00 = 16 bit nodes
> - *   0x010 = 32 bit nodes
> - *   0x110 = 64 bit nodes
> + *   0b??1 = Root
> + *   0b?00 = 16 bit nodes
> + *   0b010 = 32 bit nodes
> + *   0b110 = 64 bit nodes
>   *
>   *  Slot size and location in the parent pointer:
>   *   type  : slot location
> - *   0x??1 : Root
> - *   0x?00 : 16 bit values, type in 0-1, slot in 2-6
> - *   0x010 : 32 bit values, type in 0-2, slot in 3-6
> - *   0x110 : 64 bit values, type in 0-2, slot in 3-6
> + *   0b??1 : Root
> + *   0b?00 : 16 bit values, type in 0-1, slot in 2-6
> + *   0b010 : 32 bit values, type in 0-2, slot in 3-6
> + *   0b110 : 64 bit values, type in 0-2, slot in 3-6
>   */
>  
>  /*
> diff --git a/lib/maple_tree.c b/lib/maple_tree.c
> index 38fb68c08291..d1d513bb6e95 100644
> --- a/lib/maple_tree.c
> +++ b/lib/maple_tree.c
> @@ -405,11 +405,11 @@ static __always_inline bool mt_is_alloc(struct maple_tree *mt)
>   * a reuse of the last bit in the node type.  This is possible by using bit 1 to
>   * indicate if bit 2 is part of the type or the slot.
>   *
> - * Note types:
> - *  0x??1 = Root
> - *  0x?00 = 16 bit nodes
> - *  0x010 = 32 bit nodes
> - *  0x110 = 64 bit nodes
> + * Node types:
> + *  0b??1 = Root
> + *  0b?00 = 16 bit nodes
> + *  0b010 = 32 bit nodes
> + *  0b110 = 64 bit nodes
>   *
>   * Slot size and alignment
>   *  0b??1 : Root
> @@ -427,7 +427,7 @@ static __always_inline bool mt_is_alloc(struct maple_tree *mt)
>  #define MAPLE_PARENT_16B_SLOT_MASK	0xFC
>  
>  #define MAPLE_PARENT_RANGE64		0x06
> -#define MAPLE_PARENT_RANGE32		0x04
> +#define MAPLE_PARENT_RANGE32		0x02
>  #define MAPLE_PARENT_NOT_RANGE16	0x02
>  
>  /*
> -- 
> 2.43.0
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-08-26 15:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-26 15:13 [PATCH] maple_tree: fix MAPLE_PARENT_RANGE32 and parent pointer docs Sidhartha Kumar
2025-08-26 15:24 ` Liam R. Howlett

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).