]> git.ipfire.org Git - thirdparty/linux.git/commit
list: add kunit test for private list primitives
authorPasha Tatashin <pasha.tatashin@soleen.com>
Thu, 18 Dec 2025 15:57:49 +0000 (10:57 -0500)
committerAndrew Morton <akpm@linux-foundation.org>
Sun, 8 Feb 2026 08:13:32 +0000 (00:13 -0800)
commit66bd8501ceb4782b10dfa009085d9b3f4efecad6
tree8e9a0d430315004f8704a70031bc7fdc6b4b24bd
parent989b3c5af63ecb1cbaf1598fe3f79865538bc1ea
list: add kunit test for private list primitives

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.

Link: https://lkml.kernel.org/r/20251218155752.3045808-3-pasha.tatashin@soleen.com
Signed-off-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Reviewed-by: David Gow <davidgow@google.com>
Cc: Alexander Graf <graf@amazon.com>
Cc: David Matlack <dmatlack@google.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Kees Cook <kees@kernel.org>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Petr Mladek <pmladek@suse.com>
Cc: Pratyush Yadav <pratyush@kernel.org>
Cc: Samiullah Khawaja <skhawaja@google.com>
Cc: Tamir Duberstein <tamird@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
lib/Kconfig.debug
lib/tests/Makefile
lib/tests/list-private-test.c [new file with mode: 0644]