Skip to content

Commit e1baf5e

Browse files
cmuellnerpalmer-dabbelt
authored andcommitted
tools: selftests: riscv: Fix compile warnings in vector tests
GCC prints a couple of format string warnings when compiling the vector tests. Let's follow the recommendation in Documentation/printk-formats.txt to fix these warnings. Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu> Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Link: https://lore.kernel.org/r/20231123185821.2272504-5-christoph.muellner@vrull.eu Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
1 parent b250c90 commit e1baf5e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

tools/testing/selftests/riscv/vector/v_initval_nolibc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ int main(void)
2727

2828
datap = malloc(MAX_VSIZE);
2929
if (!datap) {
30-
ksft_test_result_fail("fail to allocate memory for size = %lu\n", MAX_VSIZE);
30+
ksft_test_result_fail("fail to allocate memory for size = %d\n", MAX_VSIZE);
3131
exit(-1);
3232
}
3333

tools/testing/selftests/riscv/vector/vstate_prctl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ int test_and_compare_child(long provided, long expected, int inherit)
6868
}
6969
rc = launch_test(inherit);
7070
if (rc != expected) {
71-
ksft_test_result_fail("Test failed, check %d != %d\n", rc,
71+
ksft_test_result_fail("Test failed, check %d != %ld\n", rc,
7272
expected);
7373
return -2;
7474
}
@@ -87,7 +87,7 @@ int main(void)
8787
pair.key = RISCV_HWPROBE_KEY_IMA_EXT_0;
8888
rc = riscv_hwprobe(&pair, 1, 0, NULL, 0);
8989
if (rc < 0) {
90-
ksft_test_result_fail("hwprobe() failed with %d\n", rc);
90+
ksft_test_result_fail("hwprobe() failed with %ld\n", rc);
9191
return -1;
9292
}
9393

0 commit comments

Comments
 (0)