Re: [PATCH v1 2/3] list: add kunit test for private list primitives

From: Pasha Tatashin

Date: Sat Nov 29 2025 - 14:48:42 EST


On Sat, Nov 29, 2025 at 2:47 AM David Gow <davidgow@xxxxxxxxxx> wrote:
>
> On Thu, 27 Nov 2025 at 02:57, Pasha Tatashin <pasha.tatashin@xxxxxxxxxx> wrote:
> >
> > Add a KUnit test suite for the new private list primitives.
> >
> > The test defines a struct with a __private list_head and exercises every
> > macro defined in <linux/list_private.h>.
> >
> > This ensures that the macros correctly handle the ACCESS_PRIVATE()
> > abstraction and compile without warnings when acting on private members,
> > verifying that qualifiers are stripped and offsets are calculated
> > correctly.
> >
> > Signed-off-by: Pasha Tatashin <pasha.tatashin@xxxxxxxxxx>
> > ---
>
> Thanks -- I'm glad to see tests added with this!
>
> I'd be okay with this living in the same config option as the other
> list tests (LIST_KUNIT_TEST) if you'd prefer, but don't particularly
> mind either way.

I prefer to keep them separate just because they work differently. The
other list tests emphasis on runtime correctness, and here emphasizes
on verifying ACCESS_PRIVATE() does not generate compiler warnings.

> Reviewed-by: David Gow <davidgow@xxxxxxxxxx>

Thanks!

Pasha