tools: selftests: riscv: Fix compile warnings in hwprobe
authorChristoph Müllner <christoph.muellner@vrull.eu>
Thu, 23 Nov 2023 18:58:17 +0000 (19:58 +0100)
committerPalmer Dabbelt <palmer@rivosinc.com>
Thu, 11 Jan 2024 16:02:47 +0000 (08:02 -0800)
GCC prints a couple of format string warnings when compiling
the hwprobe 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-2-christoph.muellner@vrull.eu
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
tools/testing/selftests/riscv/hwprobe/hwprobe.c

index c474891df307140fdd21a2a89b4d495790b47181..abb825811c70e5a7689f8c84d93b81fed2809737 100644 (file)
@@ -29,7 +29,7 @@ int main(int argc, char **argv)
                /* Fail if the kernel claims not to recognize a base key. */
                if ((i < 4) && (pairs[i].key != i))
                        ksft_exit_fail_msg("Failed to recognize base key: key != i, "
-                                          "key=%ld, i=%ld\n", pairs[i].key, i);
+                                          "key=%lld, i=%ld\n", pairs[i].key, i);
 
                if (pairs[i].key != RISCV_HWPROBE_KEY_BASE_BEHAVIOR)
                        continue;
@@ -37,7 +37,7 @@ int main(int argc, char **argv)
                if (pairs[i].value & RISCV_HWPROBE_BASE_BEHAVIOR_IMA)
                        continue;
 
-               ksft_exit_fail_msg("Unexpected pair: (%ld, %ld)\n", pairs[i].key, pairs[i].value);
+               ksft_exit_fail_msg("Unexpected pair: (%lld, %llu)\n", pairs[i].key, pairs[i].value);
        }
 
        out = riscv_hwprobe(pairs, 8, 0, 0, 0);