From: Dev Jain <dev.jain@arm.com>
To: Mark Brown <broonie@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com,
will@kernel.org, shuah@kernel.org,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
suzuki.poulose@arm.com, Anshuman.Khandual@arm.com
Subject: Re: [PATCH] selftests: arm64: Fix redundancy of a testcase
Date: Wed, 5 Jun 2024 17:56:25 +0530 [thread overview]
Message-ID: <9710a691-1c94-4f0b-b320-9fc78ee15ae8@arm.com> (raw)
In-Reply-To: <a518770a-371e-4333-b85d-6a5808a7ac09@sirena.org.uk>
On 6/5/24 17:30, Mark Brown wrote:
> On Wed, Jun 05, 2024 at 05:24:48PM +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.
> Please don't combine unrelated changes into a single patch.
I shall take care of that in the future.
>
>> /* ...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");
> This is a good fix:
>
> Reviewed-by: Mark Brown <broonie@kernel.org>
Thanks!
>
>> @@ -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];
> I'm less convinced that this is a good style change.
Well, what I have seen usually is, when we add 1, we
use prefix/postfix increment, and do a "+=" when it
is not 1. But, I get your point: such style may confuse
people into thinking that we are doing an index/pointer
increment, since that is the usual usecase for this.
next prev parent reply other threads:[~2024-06-05 12:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-05 11:54 [PATCH] selftests: arm64: Fix redundancy of a testcase Dev Jain
2024-06-05 12:00 ` Mark Brown
2024-06-05 12:26 ` Dev Jain [this message]
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=9710a691-1c94-4f0b-b320-9fc78ee15ae8@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