Re: [PATCH v2] maple_tree: document that "last" in mtree_insert_range() is inclusive

From: SeongJae Park

Date: Wed May 13 2026 - 21:43:00 EST


On Tue, 12 May 2026 17:56:23 -0400 Steven Rostedt <rostedt@xxxxxxxxxx> wrote:

> From: Steven Rostedt <rostedt@xxxxxxxxxxx>
>
> The kernel doc of mtree_insert_range() does not state if the address
> represented by the "last" parameter is inclusive or exclusive. This can
> lead to bugs by code that assumes it is exclusive. Explicitly state that
> the parameter is inclusive.
>
> Signed-off-by: Steven Rostedt <rostedt@xxxxxxxxxxx>

Acked-by: SeongJae Park <sj@xxxxxxxxxx>

> ---
> Changes since v1: https://patch.msgid.link/20260506105218.2d027cc0@fedora
>
> - Use "(inclusive)" instead of adding '[' ']' around "end". (Alice Ryhl)
>
> - Add "from [first, last]" in the short description. (Liam Howlett)
>
> lib/maple_tree.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/lib/maple_tree.c b/lib/maple_tree.c
> index d18d7ed9ab67..7f6c9b729a1a 100644
> --- a/lib/maple_tree.c
> +++ b/lib/maple_tree.c
> @@ -5727,13 +5727,16 @@ int mtree_store(struct maple_tree *mt, unsigned long index, void *entry,
> EXPORT_SYMBOL(mtree_store);
>
> /**
> - * mtree_insert_range() - Insert an entry at a given range if there is no value.
> + * mtree_insert_range() - Insert an entry from [first, last] at a given range
> + * if there is no value.

It feels "at a given range" bit repetitive to me. s/at a given range// ?


Thanks,
SJ

[...]