Skip to content

Commit 32f2493

Browse files
ColinIanKingborkmann
authored andcommitted
samples/bpf: Use %lu format specifier for unsigned long values
Currently %ld format specifiers are being used for unsigned long values. Fix this by using %lu instead. Cleans up cppcheck warnings: warning: %ld in format string (no. 1) requires 'long' but the argument type is 'unsigned long'. [invalidPrintfArgType_sint] Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Reviewed-by: Randy Dunlap <rdunlap@infradead.org> Link: https://lore.kernel.org/bpf/20231219152307.368921-1-colin.i.king@gmail.com
1 parent 441c725 commit 32f2493

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

samples/bpf/cpustat_user.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ static void cpu_stat_print(void)
6666

6767
printf("CPU-%-6d ", j);
6868
for (i = 0; i < MAX_CSTATE_ENTRIES; i++)
69-
printf("%-11ld ", data->cstate[i] / 1000000);
69+
printf("%-11lu ", data->cstate[i] / 1000000);
7070

7171
for (i = 0; i < MAX_PSTATE_ENTRIES; i++)
72-
printf("%-11ld ", data->pstate[i] / 1000000);
72+
printf("%-11lu ", data->pstate[i] / 1000000);
7373

7474
printf("\n");
7575
}

0 commit comments

Comments
 (0)