Re: [PATCH 1/2] Documentation: maple_tree: Point out constraint when using xa_{mk, to}_value

From: Wei-Lin Chang

Date: Wed May 06 2026 - 05:12:25 EST


On Mon, May 04, 2026 at 09:32:38PM +0100, Matthew Wilcox wrote:
> On Mon, May 04, 2026 at 05:57:45PM +0100, Wei-Lin Chang wrote:
> > Using xa_{mk, to}_value when storing values loses the information of
> > the top bit from the left shift, point that out in the doc.
>
> I don't know if that's necessary ... it's obvious when looking at the
> function:
>
> static inline void *xa_mk_value(unsigned long v)
> {
> WARN_ON((long)v < 0);
> return (void *)((v << 1) | 1);
> }
>
> and if you ignore it, you'll find out. But if this needs to be
> documented anywhere, it's in the kernel-doc for xa_mk_value()
> and not in the maple tree docs.

Yeah this makes sense, thanks for having a look.

Thanks,
Wei-Lin Chang