Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: Dev Jain <dev.jain@arm.com>
To: linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com,
	will@kernel.org, shuah@kernel.org,
	linux-kselftest@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, broonie@kernel.org,
	suzuki.poulose@arm.com, Anshuman.Khandual@arm.com,
	Dev Jain <dev.jain@arm.com>
Subject: [PATCH] selftests: arm64: Fix redundancy of a testcase
Date: Wed,  5 Jun 2024 17:24:48 +0530	[thread overview]
Message-ID: <20240605115448.640717-1-dev.jain@arm.com> (raw)

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(-)

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) {
-- 
2.39.2


             reply	other threads:[~2024-06-05 11:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-05 11:54 Dev Jain [this message]
2024-06-05 12:00 ` [PATCH] selftests: arm64: Fix redundancy of a testcase Mark Brown
2024-06-05 12:26   ` Dev Jain
2024-06-12 16:08 ` Catalin Marinas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240605115448.640717-1-dev.jain@arm.com \
    --to=dev.jain@arm.com \
    --cc=Anshuman.Khandual@arm.com \
    --cc=broonie@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=shuah@kernel.org \
    --cc=suzuki.poulose@arm.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox