Skip to content

Commit 9c49085

Browse files
ben717-linuxpalmer-dabbelt
authored andcommitted
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 <[email protected]> Reviewed-by: Alexandre Ghiti <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent 17c67ed commit 9c49085

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/perf/arch/riscv/util/header.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ static char *_get_cpuid(void)
4141
char *mimpid = NULL;
4242
char *cpuid = NULL;
4343
int read;
44-
unsigned long line_sz;
44+
size_t line_sz;
4545
FILE *cpuinfo;
4646

4747
cpuinfo = fopen(CPUINFO, "r");

0 commit comments

Comments
 (0)