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>
This commit is contained in:
Ben Zong-You Xie 2024-03-05 20:05:01 +08:00 committed by Palmer Dabbelt
parent 17c67ed752
commit 9c49085d69
No known key found for this signature in database
GPG Key ID: 2E1319F35FBB1889
1 changed files with 1 additions and 1 deletions

View 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");