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 <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-3-christoph.muellner@vrull.eu Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
1 parent b91c26f commit ac7b2a0

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • tools/testing/selftests/riscv/hwprobe

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)