Commit 9c49085d authored by Ben Zong-You Xie's avatar Ben Zong-You Xie Committed by Palmer Dabbelt

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: default avatarBen Zong-You Xie <ben717@andestech.com>
Reviewed-by: default avatarAlexandre Ghiti <alexghiti@rivosinc.com>
Link: https://lore.kernel.org/r/20240305120501.1785084-3-ben717@andestech.comSigned-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
parent 17c67ed7
...@@ -41,7 +41,7 @@ static char *_get_cpuid(void) ...@@ -41,7 +41,7 @@ static char *_get_cpuid(void)
char *mimpid = NULL; char *mimpid = NULL;
char *cpuid = NULL; char *cpuid = NULL;
int read; int read;
unsigned long line_sz; size_t line_sz;
FILE *cpuinfo; FILE *cpuinfo;
cpuinfo = fopen(CPUINFO, "r"); cpuinfo = fopen(CPUINFO, "r");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment