Skip to contentSkip to conversation

kselftest/arm64: Fix build warnings for ptrace

PATCH In review Dev Jain 4 participants 4 messages Aug 30, 2024

Subsystems (2)
lore
Share & tools
lore

Dev Jain

author
#0 lore raw

PATCH 1/1 kselftest/arm64: Fix build warnings for ptrace

A "%s" is missing in ksft_exit_fail_msg(); instead, use the newly introduced ksft_exit_fail_perror().

---
 tools/testing/selftests/arm64/abi/ptrace.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/testing/selftests/arm64/abi/ptrace.c +2 -2
index e4fa507cbdd0..b51d21f78cf9 100644
@@ -163,10 +163,10 @@ static void test_hw_debug(pid_t child, int type, const char *type_name)
 static int do_child(void)
 {
 	if (ptrace(PTRACE_TRACEME, -1, NULL, NULL))
-		ksft_exit_fail_msg("PTRACE_TRACEME", strerror(errno));
+		ksft_exit_fail_perror("PTRACE_TRACEME");
 
 	if (raise(SIGSTOP))
-		ksft_exit_fail_msg("raise(SIGSTOP)", strerror(errno));
+		ksft_exit_fail_perror("raise(SIGSTOP)");
 
 	return EXIT_SUCCESS;
 }
Signature · 1 line
2.30.2
maintainer Reviewed-by on v1 1/1
#2 lore raw
In reply to Dev Jain
Quoted 15 lines · Dev Jain

A "%s" is missing in ksft_exit_fail_msg(); instead, use the newly introduced ksft_exit_fail_perror().

---
  tools/testing/selftests/arm64/abi/ptrace.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
tools/testing/selftests/arm64/abi/ptrace.c +0 -0
index e4fa507cbdd0..b51d21f78cf9 100644
@@ -163,10 +163,10 @@ static void test_hw_debug(pid_t child, int type, const char *type_name)
  static int do_child(void)
  {

tools/testing/selftests/arm64/abi/ptrace.c static void test_hw_debug(pid_t child, int type, const char *type_name) · line 172

Quoted 10 lines
tools/testing/selftests/arm64/abi/ptrace.c +2 -2
  	if (ptrace(PTRACE_TRACEME, -1, NULL, NULL))
-		ksft_exit_fail_msg("PTRACE_TRACEME", strerror(errno));
+		ksft_exit_fail_perror("PTRACE_TRACEME");
 
  	if (raise(SIGSTOP))
-		ksft_exit_fail_msg("raise(SIGSTOP)", strerror(errno));
+		ksft_exit_fail_perror("raise(SIGSTOP)");
 
  	return EXIT_SUCCESS;
  }

Thanks for doing this.

thanks,
-- Shuah

maintainer
#3 lore raw
In reply to Dev Jain
Quoted 4 lines · Dev Jain

A "%s" is missing in ksft_exit_fail_msg(); instead, use the newly introduced ksft_exit_fail_perror().

Applied to arm64 (for-next/selftests), thanks!

[1/1] kselftest/arm64: Fix build warnings for ptrace

      https://git.kernel.org/arm64/c/d736d4fc7630

Cheers,

Signature · 5 lines
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev