* [PATCH] selftests/arm64: Fix build warnings for abi
@ 2024-08-27 5:18 Dev Jain
2024-08-27 12:33 ` Will Deacon
2024-08-28 10:40 ` Mark Brown
0 siblings, 2 replies; 8+ messages in thread
From: Dev Jain @ 2024-08-27 5:18 UTC (permalink / raw)
To: shuah, linux-arm-kernel, linux-kselftest, Catalin.Marinas, will
Cc: broonie, ryan.roberts, Anshuman.Khandual, aneesh.kumar,
linux-kernel, Dev Jain
A "%s" is missing in ksft_exit_fail_msg(); instead, use the newly
introduced ksft_exit_fail_perror(). Also, uint64_t corresponds to
unsigned 64-bit integer, so use %lx instead of %llx.
Signed-off-by: Dev Jain <dev.jain@arm.com>
---
The changes in ptrace.c were earlier a part of the following:
https://lore.kernel.org/all/20240625122408.1439097-6-dev.jain@arm.com/
which were reviewed by Mark.
tools/testing/selftests/arm64/abi/ptrace.c | 4 ++--
tools/testing/selftests/arm64/abi/syscall-abi.c | 8 ++++----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/tools/testing/selftests/arm64/abi/ptrace.c b/tools/testing/selftests/arm64/abi/ptrace.c
index e4fa507cbdd0..b51d21f78cf9 100644
--- a/tools/testing/selftests/arm64/abi/ptrace.c
+++ b/tools/testing/selftests/arm64/abi/ptrace.c
@@ -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;
}
diff --git a/tools/testing/selftests/arm64/abi/syscall-abi.c b/tools/testing/selftests/arm64/abi/syscall-abi.c
index d704511a0955..5ec9a18ec802 100644
--- a/tools/testing/selftests/arm64/abi/syscall-abi.c
+++ b/tools/testing/selftests/arm64/abi/syscall-abi.c
@@ -81,7 +81,7 @@ static int check_gpr(struct syscall_cfg *cfg, int sve_vl, int sme_vl, uint64_t s
*/
for (i = 9; i < ARRAY_SIZE(gpr_in); i++) {
if (gpr_in[i] != gpr_out[i]) {
- ksft_print_msg("%s SVE VL %d mismatch in GPR %d: %llx != %llx\n",
+ ksft_print_msg("%s SVE VL %d mismatch in GPR %d: %lx != %lx\n",
cfg->name, sve_vl, i,
gpr_in[i], gpr_out[i]);
errors++;
@@ -112,7 +112,7 @@ static int check_fpr(struct syscall_cfg *cfg, int sve_vl, int sme_vl,
if (!sve_vl && !(svcr & SVCR_SM_MASK)) {
for (i = 0; i < ARRAY_SIZE(fpr_in); i++) {
if (fpr_in[i] != fpr_out[i]) {
- ksft_print_msg("%s Q%d/%d mismatch %llx != %llx\n",
+ ksft_print_msg("%s Q%d/%d mismatch %lx != %lx\n",
cfg->name,
i / 2, i % 2,
fpr_in[i], fpr_out[i]);
@@ -294,13 +294,13 @@ static int check_svcr(struct syscall_cfg *cfg, int sve_vl, int sme_vl,
int errors = 0;
if (svcr_out & SVCR_SM_MASK) {
- ksft_print_msg("%s Still in SM, SVCR %llx\n",
+ ksft_print_msg("%s Still in SM, SVCR %lx\n",
cfg->name, svcr_out);
errors++;
}
if ((svcr_in & SVCR_ZA_MASK) != (svcr_out & SVCR_ZA_MASK)) {
- ksft_print_msg("%s PSTATE.ZA changed, SVCR %llx != %llx\n",
+ ksft_print_msg("%s PSTATE.ZA changed, SVCR %lx != %lx\n",
cfg->name, svcr_in, svcr_out);
errors++;
}
--
2.30.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] selftests/arm64: Fix build warnings for abi
2024-08-27 5:18 [PATCH] selftests/arm64: Fix build warnings for abi Dev Jain
@ 2024-08-27 12:33 ` Will Deacon
2024-08-28 3:49 ` Dev Jain
2024-08-28 11:01 ` Mark Brown
2024-08-28 10:40 ` Mark Brown
1 sibling, 2 replies; 8+ messages in thread
From: Will Deacon @ 2024-08-27 12:33 UTC (permalink / raw)
To: Dev Jain
Cc: shuah, linux-arm-kernel, linux-kselftest, Catalin.Marinas,
broonie, ryan.roberts, Anshuman.Khandual, aneesh.kumar,
linux-kernel
On Tue, Aug 27, 2024 at 10:48:51AM +0530, Dev Jain wrote:
> A "%s" is missing in ksft_exit_fail_msg(); instead, use the newly
> introduced ksft_exit_fail_perror(). Also, uint64_t corresponds to
> unsigned 64-bit integer, so use %lx instead of %llx.
What's wrong with using %llx for a uint64_t? I think that part of the
code is fine as-is.
Will
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] selftests/arm64: Fix build warnings for abi
2024-08-27 12:33 ` Will Deacon
@ 2024-08-28 3:49 ` Dev Jain
2024-08-28 11:01 ` Mark Brown
1 sibling, 0 replies; 8+ messages in thread
From: Dev Jain @ 2024-08-28 3:49 UTC (permalink / raw)
To: Will Deacon
Cc: shuah, linux-arm-kernel, linux-kselftest, Catalin.Marinas,
broonie, ryan.roberts, Anshuman.Khandual, aneesh.kumar,
linux-kernel
On 8/27/24 18:03, Will Deacon wrote:
> On Tue, Aug 27, 2024 at 10:48:51AM +0530, Dev Jain wrote:
>> A "%s" is missing in ksft_exit_fail_msg(); instead, use the newly
>> introduced ksft_exit_fail_perror(). Also, uint64_t corresponds to
>> unsigned 64-bit integer, so use %lx instead of %llx.
> What's wrong with using %llx for a uint64_t? I think that part of the
> code is fine as-is.
I get a lot of warnings like these:
https://www.codedump.xyz/cpp/Zs6d7saC1IRuWV2O
>
> Will
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] selftests/arm64: Fix build warnings for abi
2024-08-27 5:18 [PATCH] selftests/arm64: Fix build warnings for abi Dev Jain
2024-08-27 12:33 ` Will Deacon
@ 2024-08-28 10:40 ` Mark Brown
2024-08-29 6:25 ` Dev Jain
1 sibling, 1 reply; 8+ messages in thread
From: Mark Brown @ 2024-08-28 10:40 UTC (permalink / raw)
To: Dev Jain
Cc: shuah, linux-arm-kernel, linux-kselftest, Catalin.Marinas, will,
ryan.roberts, Anshuman.Khandual, aneesh.kumar, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 883 bytes --]
On Tue, Aug 27, 2024 at 10:48:51AM +0530, Dev Jain wrote:
> - 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)");
The idea with these is to include the error code as well so adding the
%s would be better.
> for (i = 9; i < ARRAY_SIZE(gpr_in); i++) {
> if (gpr_in[i] != gpr_out[i]) {
> - ksft_print_msg("%s SVE VL %d mismatch in GPR %d: %llx != %llx\n",
> + ksft_print_msg("%s SVE VL %d mismatch in GPR %d: %lx != %lx\n",
> cfg->name, sve_vl, i,
> gpr_in[i], gpr_out[i]);
> errors++;
This is a different pattern of warning, it'd be easier to review if each
patch only followed one pattern. There's no code overlap between the
changes.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] selftests/arm64: Fix build warnings for abi
2024-08-27 12:33 ` Will Deacon
2024-08-28 3:49 ` Dev Jain
@ 2024-08-28 11:01 ` Mark Brown
2024-08-29 6:28 ` Dev Jain
1 sibling, 1 reply; 8+ messages in thread
From: Mark Brown @ 2024-08-28 11:01 UTC (permalink / raw)
To: Will Deacon
Cc: Dev Jain, shuah, linux-arm-kernel, linux-kselftest,
Catalin.Marinas, ryan.roberts, Anshuman.Khandual, aneesh.kumar,
linux-kernel
[-- Attachment #1: Type: text/plain, Size: 519 bytes --]
On Tue, Aug 27, 2024 at 01:33:47PM +0100, Will Deacon wrote:
> On Tue, Aug 27, 2024 at 10:48:51AM +0530, Dev Jain wrote:
> > A "%s" is missing in ksft_exit_fail_msg(); instead, use the newly
> > introduced ksft_exit_fail_perror(). Also, uint64_t corresponds to
> > unsigned 64-bit integer, so use %lx instead of %llx.
> What's wrong with using %llx for a uint64_t? I think that part of the
> code is fine as-is.
IIRC there's some printf format specifiers specific to uint64_t which
are probably a better choice here.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] selftests/arm64: Fix build warnings for abi
2024-08-28 10:40 ` Mark Brown
@ 2024-08-29 6:25 ` Dev Jain
2024-08-29 11:02 ` Mark Brown
0 siblings, 1 reply; 8+ messages in thread
From: Dev Jain @ 2024-08-29 6:25 UTC (permalink / raw)
To: Mark Brown
Cc: shuah, linux-arm-kernel, linux-kselftest, Catalin.Marinas, will,
ryan.roberts, Anshuman.Khandual, aneesh.kumar, linux-kernel
On 8/28/24 16:10, Mark Brown wrote:
> On Tue, Aug 27, 2024 at 10:48:51AM +0530, Dev Jain wrote:
>
>> - 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)");
> The idea with these is to include the error code as well so adding the
> %s would be better.
ksft_exit_fail_perror() can do that thing for us.
>
>> for (i = 9; i < ARRAY_SIZE(gpr_in); i++) {
>> if (gpr_in[i] != gpr_out[i]) {
>> - ksft_print_msg("%s SVE VL %d mismatch in GPR %d: %llx != %llx\n",
>> + ksft_print_msg("%s SVE VL %d mismatch in GPR %d: %lx != %lx\n",
>> cfg->name, sve_vl, i,
>> gpr_in[i], gpr_out[i]);
>> errors++;
> This is a different pattern of warning, it'd be easier to review if each
> patch only followed one pattern. There's no code overlap between the
> changes.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] selftests/arm64: Fix build warnings for abi
2024-08-28 11:01 ` Mark Brown
@ 2024-08-29 6:28 ` Dev Jain
0 siblings, 0 replies; 8+ messages in thread
From: Dev Jain @ 2024-08-29 6:28 UTC (permalink / raw)
To: Mark Brown, Will Deacon
Cc: shuah, linux-arm-kernel, linux-kselftest, Catalin.Marinas,
ryan.roberts, Anshuman.Khandual, aneesh.kumar, linux-kernel
On 8/28/24 16:31, Mark Brown wrote:
> On Tue, Aug 27, 2024 at 01:33:47PM +0100, Will Deacon wrote:
>> On Tue, Aug 27, 2024 at 10:48:51AM +0530, Dev Jain wrote:
>>> A "%s" is missing in ksft_exit_fail_msg(); instead, use the newly
>>> introduced ksft_exit_fail_perror(). Also, uint64_t corresponds to
>>> unsigned 64-bit integer, so use %lx instead of %llx.
>> What's wrong with using %llx for a uint64_t? I think that part of the
>> code is fine as-is.
> IIRC there's some printf format specifiers specific to uint64_t which
> are probably a better choice here.
Well, then I will just send a patch fixing only the %s thing; I don't
want to get lost into format specifiers right now :)
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] selftests/arm64: Fix build warnings for abi
2024-08-29 6:25 ` Dev Jain
@ 2024-08-29 11:02 ` Mark Brown
0 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2024-08-29 11:02 UTC (permalink / raw)
To: Dev Jain
Cc: shuah, linux-arm-kernel, linux-kselftest, Catalin.Marinas, will,
ryan.roberts, Anshuman.Khandual, aneesh.kumar, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 473 bytes --]
On Thu, Aug 29, 2024 at 11:55:33AM +0530, Dev Jain wrote:
> On 8/28/24 16:10, Mark Brown wrote:
> > > - ksft_exit_fail_msg("raise(SIGSTOP)", strerror(errno));
> > > + ksft_exit_fail_perror("raise(SIGSTOP)");
> > The idea with these is to include the error code as well so adding the
> > %s would be better.
> ksft_exit_fail_perror() can do that thing for us.
Oh, sorry - I missed that it was changing to _perror() as well as
removing the argument. Yes, that's fine.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2024-08-29 11:02 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-27 5:18 [PATCH] selftests/arm64: Fix build warnings for abi Dev Jain
2024-08-27 12:33 ` Will Deacon
2024-08-28 3:49 ` Dev Jain
2024-08-28 11:01 ` Mark Brown
2024-08-29 6:28 ` Dev Jain
2024-08-28 10:40 ` Mark Brown
2024-08-29 6:25 ` Dev Jain
2024-08-29 11:02 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox