diff mbox series

selftests: arm64: Fix redundancy of a testcase

Message ID 20240605115448.640717-1-dev.jain@arm.com
State New
Headers show
Series selftests: arm64: Fix redundancy of a testcase | expand

Commit Message

Dev Jain June 5, 2024, 11:54 a.m. UTC
Currently, we are writing the same value as we read, into the TLS
register; hence, we cannot confirm updation of the register, making the
testcase "verify_tpidr_one" redundant. Fix this; while at it, do a style
change.

Signed-off-by: Dev Jain <dev.jain@arm.com>
---
 tools/testing/selftests/arm64/abi/ptrace.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Catalin Marinas June 12, 2024, 4:08 p.m. UTC | #1
On Wed, 05 Jun 2024 17:24:48 +0530, Dev Jain wrote:
> Currently, we are writing the same value as we read, into the TLS
> register; hence, we cannot confirm updation of the register, making the
> testcase "verify_tpidr_one" redundant. Fix this; while at it, do a style
> change.
> 
> 

Applied to arm64 (for-next/kselftest), thanks! I removed the increment
style change.

[1/1] selftests: arm64: Fix redundancy of a testcase
      https://git.kernel.org/arm64/c/031d1f20d5db
diff mbox series

Patch

diff --git a/tools/testing/selftests/arm64/abi/ptrace.c b/tools/testing/selftests/arm64/abi/ptrace.c
index abe4d58d731d..c105703442f9 100644
--- a/tools/testing/selftests/arm64/abi/ptrace.c
+++ b/tools/testing/selftests/arm64/abi/ptrace.c
@@ -47,7 +47,7 @@  static void test_tpidr(pid_t child)
 
 	/* ...write a new value.. */
 	write_iov.iov_len = sizeof(uint64_t);
-	write_val[0] = read_val[0]++;
+	write_val[0] = read_val[0] + 1;
 	ret = ptrace(PTRACE_SETREGSET, child, NT_ARM_TLS, &write_iov);
 	ksft_test_result(ret == 0, "write_tpidr_one\n");
 
@@ -108,7 +108,7 @@  static void test_tpidr(pid_t child)
 		/* Writing only TPIDR... */
 		write_iov.iov_len = sizeof(uint64_t);
 		memcpy(write_val, read_val, sizeof(read_val));
-		write_val[0] += 1;
+		++write_val[0];
 		ret = ptrace(PTRACE_SETREGSET, child, NT_ARM_TLS, &write_iov);
 
 		if (ret == 0) {