perf riscv: Fix the warning due to the incompatible type
authorBen Zong-You Xie <ben717@andestech.com>
Tue, 5 Mar 2024 12:05:01 +0000 (20:05 +0800)
committerPalmer Dabbelt <palmer@rivosinc.com>
Fri, 26 Apr 2024 17:21:55 +0000 (10:21 -0700)
In the 32-bit platform, the second argument of getline is expectd to be
'size_t *'(aka 'unsigned int *'), but line_sz is of type
'unsigned long *'. Therefore, declare line_sz as size_t.

Signed-off-by: Ben Zong-You Xie <ben717@andestech.com>
Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Link: https://lore.kernel.org/r/20240305120501.1785084-3-ben717@andestech.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
tools/perf/arch/riscv/util/header.c

index 4a41856938a8889403278a4ad44c599d835b887a..1b29030021eeba71e34eeb8adcf69278f11a1dda 100644 (file)
@@ -41,7 +41,7 @@ static char *_get_cpuid(void)
        char *mimpid = NULL;
        char *cpuid = NULL;
        int read;
-       unsigned long line_sz;
+       size_t line_sz;
        FILE *cpuinfo;
 
        cpuinfo = fopen(CPUINFO, "r");