[PATCH 2/3] selftests/mm: emit TAP header and use TAP skip in mremap_test

From: Song Hu

Date: Wed Aug 12 2026 - 08:15:29 EST


mremap_test calls ksft_set_plan() without ksft_print_header(), and its
get_mmap_min_addr() skip path uses a bare exit(KSFT_SKIP) that prints no
TAP line, so its output is not valid KTAP. Add the header and switch the
skip to ksft_exit_skip().

Signed-off-by: Song Hu <husong@xxxxxxxxxx>
---
tools/testing/selftests/mm/mremap_test.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/tools/testing/selftests/mm/mremap_test.c b/tools/testing/selftests/mm/mremap_test.c
index 131d9d6db867..d055a4b3b024 100644
--- a/tools/testing/selftests/mm/mremap_test.c
+++ b/tools/testing/selftests/mm/mremap_test.c
@@ -111,18 +111,15 @@ static unsigned long long get_mmap_min_addr(void)
return addr;

fp = fopen("/proc/sys/vm/mmap_min_addr", "r");
- if (fp == NULL) {
- ksft_print_msg("Failed to open /proc/sys/vm/mmap_min_addr: %s\n",
- strerror(errno));
- exit(KSFT_SKIP);
- }
+ if (!fp)
+ ksft_exit_skip("Failed to open /proc/sys/vm/mmap_min_addr: %s\n",
+ strerror(errno));

n_matched = fscanf(fp, "%llu", &addr);
if (n_matched != 1) {
- ksft_print_msg("Failed to read /proc/sys/vm/mmap_min_addr: %s\n",
- strerror(errno));
fclose(fp);
- exit(KSFT_SKIP);
+ ksft_exit_skip("Failed to read /proc/sys/vm/mmap_min_addr: %s\n",
+ strerror(errno));
}

fclose(fp);
@@ -1250,6 +1247,8 @@ int main(int argc, char **argv)
time_t t;
FILE *maps_fp;

+ ksft_print_header();
+
pattern_seed = (unsigned int) time(&t);

if (parse_args(argc, argv, &threshold_mb, &pattern_seed) < 0)
--
2.43.0