* [PATCH] selftests/breakpoints: Fix format specifier in ksft_print_msg in step_after_suspend_test.c
@ 2023-11-28 21:48 angquan yu
2023-11-30 21:34 ` Shuah Khan
0 siblings, 1 reply; 2+ messages in thread
From: angquan yu @ 2023-11-28 21:48 UTC (permalink / raw)
To: skhan
Cc: shuah, linux-kselftest, linux-kernel, linux-kernel-mentees,
angquan yu
From: angquan yu <angquan21@gmail.com>
In the function 'tools/testing/selftests/breakpoints/run_test' within
step_after_suspend_test.c, the ksft_print_msg function call incorrectly
used '$s' as a format specifier. This commit corrects this typo to use the
proper '%s' format specifier, ensuring the error message from
waitpid() is correctly displayed.
The issue manifested as a compilation warning (too many arguments
for format [-Wformat-extra-args]), potentially obscuring actual
runtime errors and complicating debugging processes.
This fix enhances the clarity of error messages during test failures
and ensures compliance with standard C format string conventions.
Signed-off-by: angquan yu <angquan21@gmail.com>
---
tools/testing/selftests/breakpoints/step_after_suspend_test.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/breakpoints/step_after_suspend_test.c b/tools/testing/selftests/breakpoints/step_after_suspend_test.c
index 2cf6f10ab..b8703c499 100644
--- a/tools/testing/selftests/breakpoints/step_after_suspend_test.c
+++ b/tools/testing/selftests/breakpoints/step_after_suspend_test.c
@@ -89,7 +89,7 @@ int run_test(int cpu)
wpid = waitpid(pid, &status, __WALL);
if (wpid != pid) {
- ksft_print_msg("waitpid() failed: $s\n", strerror(errno));
+ ksft_print_msg("waitpid() failed: %s\n", strerror(errno));
return KSFT_FAIL;
}
if (WIFEXITED(status)) {
--
2.39.2
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] selftests/breakpoints: Fix format specifier in ksft_print_msg in step_after_suspend_test.c
2023-11-28 21:48 [PATCH] selftests/breakpoints: Fix format specifier in ksft_print_msg in step_after_suspend_test.c angquan yu
@ 2023-11-30 21:34 ` Shuah Khan
0 siblings, 0 replies; 2+ messages in thread
From: Shuah Khan @ 2023-11-30 21:34 UTC (permalink / raw)
To: angquan yu
Cc: shuah, linux-kselftest, linux-kernel, linux-kernel-mentees,
Shuah Khan
On 11/28/23 14:48, angquan yu wrote:
> From: angquan yu <angquan21@gmail.com>
>
> In the function 'tools/testing/selftests/breakpoints/run_test' within
> step_after_suspend_test.c, the ksft_print_msg function call incorrectly
> used '$s' as a format specifier. This commit corrects this typo to use the
> proper '%s' format specifier, ensuring the error message from
> waitpid() is correctly displayed.
>
> The issue manifested as a compilation warning (too many arguments
> for format [-Wformat-extra-args]), potentially obscuring actual
> runtime errors and complicating debugging processes.
>
> This fix enhances the clarity of error messages during test failures
> and ensures compliance with standard C format string conventions.
>
> Signed-off-by: angquan yu <angquan21@gmail.com>
Thank you for the fix. Applied to linux-kselftest next for Linux 6.8-rc1
thanks,
-- Shuah
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-11-30 21:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-28 21:48 [PATCH] selftests/breakpoints: Fix format specifier in ksft_print_msg in step_after_suspend_test.c angquan yu
2023-11-30 21:34 ` Shuah Khan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox