[PATCH v3 0/2] selftests/mm: refactor pkey helpers and fix mmap error handling
From: Hongfu Li
Date: Tue May 26 2026 - 21:39:08 EST
The main changes in this series are to refactor shared tracing and assertion
helpers into a common file, unify both pkey selftests on pkey_assert() and
per-test tracing for consistent diagnostics, and add missing mmap() return
checks with MAP_FAILED used throughout for readability and consistency.
Hongfu Li (2):
selftests/mm: refactor pkey test helpers and unify assertions
selftests/mm: add missing mmap() return checks in pkey tests
tools/testing/selftests/mm/pkey-helpers.h | 5 +-
tools/testing/selftests/mm/pkey-powerpc.h | 2 +-
.../selftests/mm/pkey_sighandler_tests.c | 110 +++++++++---------
tools/testing/selftests/mm/pkey_util.c | 81 +++++++++++++
tools/testing/selftests/mm/protection_keys.c | 98 ++--------------
5 files changed, 150 insertions(+), 146 deletions(-)
---
v3:
- Use pkey_assert() for remaining sigaction() and clone_raw() error
checks for consistency.
v2:
- Update commit message
- Move shared tracing and assertion helpers to a common file,
replace assert() with pkey_assert() in sighandler tests
- Drop assert() from main() in protection_keys.c and add a proper error
message instead.
- Link to v1: https://lore.kernel.org/all/20260518082120.3890552-1-lihongfu@xxxxxxxxxx/
--
2.50.1