summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Zong-You Xie <ben717@andestech.com>2024-03-05 20:05:01 +0800
committerPalmer Dabbelt <palmer@rivosinc.com>2024-04-26 10:21:55 -0700
commit9c49085d69ec8ca4eea254d0f426676232549f84 (patch)
tree9a78ca1aa515af4bb99fab669bc5492eb031cb58
parent17c67ed752d6a456602b3dbb25c5ae4d3de5deab (diff)
perf riscv: Fix the warning due to the incompatible type
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>
-rw-r--r--tools/perf/arch/riscv/util/header.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/arch/riscv/util/header.c b/tools/perf/arch/riscv/util/header.c
index 4a41856938a8..1b29030021ee 100644
--- a/tools/perf/arch/riscv/util/header.c
+++ b/tools/perf/arch/riscv/util/header.c
@@ -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");