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

Wei-Lin Chang weilin.chang at arm.com
Wed May 6 02:07:03 PDT 2026


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



More information about the maple-tree mailing list