Skip to content

Commit ac7b2a0

Browse files
cmuellnerpalmer-dabbelt
authored andcommitted
tools: selftests: riscv: Fix compile warnings in cbo
GCC prints a couple of format string warnings when compiling the cbo test. Let's follow the recommendation in Documentation/printk-formats.txt to fix these warnings. Signed-off-by: Christoph Müllner <[email protected]> Reviewed-by: Alexandre Ghiti <[email protected]> Reviewed-by: Andrew Jones <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent b91c26f commit ac7b2a0

File tree

1 file changed

+3
-3
lines changed
  • tools/testing/selftests/riscv/hwprobe

1 file changed

+3
-3
lines changed

tools/testing/selftests/riscv/hwprobe/cbo.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ static void test_zicboz(void *arg)
9797
block_size = pair.value;
9898
ksft_test_result(rc == 0 && pair.key == RISCV_HWPROBE_KEY_ZICBOZ_BLOCK_SIZE &&
9999
is_power_of_2(block_size), "Zicboz block size\n");
100-
ksft_print_msg("Zicboz block size: %ld\n", block_size);
100+
ksft_print_msg("Zicboz block size: %llu\n", block_size);
101101

102102
illegal_insn = false;
103103
cbo_zero(&mem[block_size]);
@@ -121,7 +121,7 @@ static void test_zicboz(void *arg)
121121
for (j = 0; j < block_size; ++j) {
122122
if (mem[i * block_size + j] != expected) {
123123
ksft_test_result_fail("cbo.zero check\n");
124-
ksft_print_msg("cbo.zero check: mem[%d] != 0x%x\n",
124+
ksft_print_msg("cbo.zero check: mem[%llu] != 0x%x\n",
125125
i * block_size + j, expected);
126126
return;
127127
}
@@ -201,7 +201,7 @@ int main(int argc, char **argv)
201201
pair.key = RISCV_HWPROBE_KEY_IMA_EXT_0;
202202
rc = riscv_hwprobe(&pair, 1, sizeof(cpu_set_t), (unsigned long *)&cpus, 0);
203203
if (rc < 0)
204-
ksft_exit_fail_msg("hwprobe() failed with %d\n", rc);
204+
ksft_exit_fail_msg("hwprobe() failed with %ld\n", rc);
205205
assert(rc == 0 && pair.key == RISCV_HWPROBE_KEY_IMA_EXT_0);
206206

207207
if (pair.value & RISCV_HWPROBE_EXT_ZICBOZ) {

0 commit comments

Comments
 (0)