Skip to content

Commit b6bd50d

Browse files
committed
kselftest/arm64: Fix printf() compiler warnings in the arm64 fp tests
Lots of incorrect length modifiers, missing arguments or conversion specifiers. Fix them. Cc: Shuah Khan <[email protected]> Cc: Mark Brown <[email protected]> Reviewed-by: Mark Brown <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent ae465d9 commit b6bd50d

File tree

3 files changed

+19
-13
lines changed

3 files changed

+19
-13
lines changed

tools/testing/selftests/arm64/fp/sve-ptrace.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,12 @@ static void fill_buf(char *buf, size_t size)
8282
static int do_child(void)
8383
{
8484
if (ptrace(PTRACE_TRACEME, -1, NULL, NULL))
85-
ksft_exit_fail_msg("PTRACE_TRACEME", strerror(errno));
85+
ksft_exit_fail_msg("ptrace(PTRACE_TRACEME) failed: %s (%d)\n",
86+
strerror(errno), errno);
8687

8788
if (raise(SIGSTOP))
88-
ksft_exit_fail_msg("raise(SIGSTOP)", strerror(errno));
89+
ksft_exit_fail_msg("raise(SIGSTOP) failed: %s (%d)\n",
90+
strerror(errno), errno);
8991

9092
return EXIT_SUCCESS;
9193
}
@@ -340,7 +342,7 @@ static void ptrace_set_sve_get_sve_data(pid_t child,
340342
data_size = SVE_PT_SVE_OFFSET + SVE_PT_SVE_SIZE(vq, SVE_PT_REGS_SVE);
341343
write_buf = malloc(data_size);
342344
if (!write_buf) {
343-
ksft_test_result_fail("Error allocating %d byte buffer for %s VL %u\n",
345+
ksft_test_result_fail("Error allocating %ld byte buffer for %s VL %u\n",
344346
data_size, type->name, vl);
345347
return;
346348
}
@@ -441,7 +443,7 @@ static void ptrace_set_sve_get_fpsimd_data(pid_t child,
441443
data_size = SVE_PT_SVE_OFFSET + SVE_PT_SVE_SIZE(vq, SVE_PT_REGS_SVE);
442444
write_buf = malloc(data_size);
443445
if (!write_buf) {
444-
ksft_test_result_fail("Error allocating %d byte buffer for %s VL %u\n",
446+
ksft_test_result_fail("Error allocating %ld byte buffer for %s VL %u\n",
445447
data_size, type->name, vl);
446448
return;
447449
}
@@ -545,7 +547,7 @@ static void ptrace_set_fpsimd_get_sve_data(pid_t child,
545547
read_sve = read_buf;
546548

547549
if (read_sve->vl != vl) {
548-
ksft_test_result_fail("Child VL != expected VL %d\n",
550+
ksft_test_result_fail("Child VL != expected VL: %u != %u\n",
549551
read_sve->vl, vl);
550552
goto out;
551553
}
@@ -555,7 +557,7 @@ static void ptrace_set_fpsimd_get_sve_data(pid_t child,
555557
case SVE_PT_REGS_FPSIMD:
556558
expected_size = SVE_PT_FPSIMD_SIZE(vq, SVE_PT_REGS_FPSIMD);
557559
if (read_sve_size < expected_size) {
558-
ksft_test_result_fail("Read %d bytes, expected %d\n",
560+
ksft_test_result_fail("Read %ld bytes, expected %ld\n",
559561
read_sve_size, expected_size);
560562
goto out;
561563
}
@@ -571,7 +573,7 @@ static void ptrace_set_fpsimd_get_sve_data(pid_t child,
571573
case SVE_PT_REGS_SVE:
572574
expected_size = SVE_PT_SVE_SIZE(vq, SVE_PT_REGS_SVE);
573575
if (read_sve_size < expected_size) {
574-
ksft_test_result_fail("Read %d bytes, expected %d\n",
576+
ksft_test_result_fail("Read %ld bytes, expected %ld\n",
575577
read_sve_size, expected_size);
576578
goto out;
577579
}

tools/testing/selftests/arm64/fp/za-ptrace.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,12 @@ static void fill_buf(char *buf, size_t size)
4848
static int do_child(void)
4949
{
5050
if (ptrace(PTRACE_TRACEME, -1, NULL, NULL))
51-
ksft_exit_fail_msg("PTRACE_TRACEME", strerror(errno));
51+
ksft_exit_fail_msg("ptrace(PTRACE_TRACEME) failed: %s (%d)",
52+
strerror(errno), errno);
5253

5354
if (raise(SIGSTOP))
54-
ksft_exit_fail_msg("raise(SIGSTOP)", strerror(errno));
55+
ksft_exit_fail_msg("raise(SIGSTOP) failed: %s (%d)\n",
56+
strerror(errno), errno);
5557

5658
return EXIT_SUCCESS;
5759
}
@@ -201,7 +203,7 @@ static void ptrace_set_get_data(pid_t child, unsigned int vl)
201203
data_size = ZA_PT_SIZE(vq);
202204
write_buf = malloc(data_size);
203205
if (!write_buf) {
204-
ksft_test_result_fail("Error allocating %d byte buffer for VL %u\n",
206+
ksft_test_result_fail("Error allocating %ld byte buffer for VL %u\n",
205207
data_size, vl);
206208
return;
207209
}

tools/testing/selftests/arm64/fp/zt-ptrace.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,12 @@ static void fill_buf(char *buf, size_t size)
4343
static int do_child(void)
4444
{
4545
if (ptrace(PTRACE_TRACEME, -1, NULL, NULL))
46-
ksft_exit_fail_msg("PTRACE_TRACEME", strerror(errno));
46+
ksft_exit_fail_msg("ptrace(PTRACE_TRACEME) failed: %s (%d)\n",
47+
strerror(errno), errno);
4748

4849
if (raise(SIGSTOP))
49-
ksft_exit_fail_msg("raise(SIGSTOP)", strerror(errno));
50+
ksft_exit_fail_msg("raise(SIGSTOP) failed: %s (%d)\n",
51+
strerror(errno), errno);
5052

5153
return EXIT_SUCCESS;
5254
}
@@ -231,7 +233,7 @@ static void ptrace_enable_za_via_zt(pid_t child)
231233
/* Should have register data */
232234
if (za_out->size < ZA_PT_SIZE(vq)) {
233235
ksft_print_msg("ZA data less than expected: %u < %u\n",
234-
za_out->size, ZA_PT_SIZE(vq));
236+
za_out->size, (unsigned int)ZA_PT_SIZE(vq));
235237
fail = true;
236238
vq = 0;
237239
}

0 commit comments

Comments
 (0)