Skip to contentSkip to conversation

selftests/breakpoints: Fix format specifier in ksft_print_msg in step_after_suspend_test.c

PATCH New angquan yu 1 participant 1 message Nov 19, 2023

Subsystems (2)
lore
Share & tools
lore

angquan yu

author
#0 lore raw

PATCH 1/2 selftests/breakpoints: Fix format specifier in ksft_print_msg in step_after_suspend_test.c

From: angquan yu <[email protected]>

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.

---
 tools/testing/selftests/breakpoints/step_after_suspend_test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/breakpoints/step_after_suspend_test.c +1 -1
index 2cf6f10ab..b8703c499 100644
@@ -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)) {
Signature · 1 line
2.39.2