Skip to content

Commit

Permalink
tools: selftests: riscv: Fix compile warnings in vector tests
Browse files Browse the repository at this point in the history
[ Upstream commit e1baf5e ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
cmuellner authored and gregkh committed Mar 1, 2024
1 parent df75b8e commit a613c64
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tools/testing/selftests/riscv/vector/v_initval_nolibc.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ int main(void)

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

Expand Down
4 changes: 2 additions & 2 deletions tools/testing/selftests/riscv/vector/vstate_prctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ int test_and_compare_child(long provided, long expected, int inherit)
}
rc = launch_test(inherit);
if (rc != expected) {
ksft_test_result_fail("Test failed, check %d != %d\n", rc,
ksft_test_result_fail("Test failed, check %d != %ld\n", rc,
expected);
return -2;
}
Expand All @@ -87,7 +87,7 @@ int main(void)
pair.key = RISCV_HWPROBE_KEY_IMA_EXT_0;
rc = riscv_hwprobe(&pair, 1, 0, NULL, 0);
if (rc < 0) {
ksft_test_result_fail("hwprobe() failed with %d\n", rc);
ksft_test_result_fail("hwprobe() failed with %ld\n", rc);
return -1;
}

Expand Down

0 comments on commit a613c64

Please sign in to comment.