Re: [PATCH v7 4/7] selftests: ksft_exit_fail_perror: support printf style arguments

Mark Brown
2026-04-01T11:03:16Z

[-- Attachment #1: Type: text/plain, Size: 1119 bytes --]

On Mon, Mar 30, 2026 at 11:15:00PM +0800, Chunyu Hu wrote:

> The ksft_exit_fail_perror function previously only accepted a single string
> argument, which limited its flexibility for providing specific context to
> failure messages.

> This change updates ksft_exit_fail_perror to support variable arguments,
> similar to ksft_exit_fail_msg. Adding the __printf(1, 2) attribute enables
> compile-time checking for format string correctness.

This is causing build regressions on the arm64 selftests:

/arm64/fp/za-fork-asm.o -o /build/stage/build-work/kselftest/arm64/fp/za-fork
In file included from za-fork.c:12:
../../kselftest.h: In function ‘ksft_exit_fail_perror’:
../../kselftest.h:427:13: error: implicit declaration of function ‘vasprintf’; d
id you mean ‘vsprintf’? [-Wimplicit-function-declaration]
427 | if (vasprintf(&buf, msg, args) == -1) {
| ^~~~~~~~~
| vsprintf

This is because za-fork uses nolibc which does not implement
vasprintf().

I need to look at why this managed to pass the build testing I do in
-next...

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]