summaryrefslogtreecommitdiff
path: root/samples/bpf
diff options
context:
space:
mode:
authorColin Ian King <colin.i.king@gmail.com>2023-12-19 18:23:07 +0300
committerDaniel Borkmann <daniel@iogearbox.net>2023-12-20 17:28:59 +0300
commit32f24938a1fce95fce314c1fa9a72af74588ea6c (patch)
treef9927d4134246e6cdbe7d57f6e9e6e46ef6f034d /samples/bpf
parent441c725ed592cb22f2a82f2827dccd045356cc81 (diff)
downloadlinux-32f24938a1fce95fce314c1fa9a72af74588ea6c.tar.xz
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
Diffstat (limited to 'samples/bpf')
-rw-r--r--samples/bpf/cpustat_user.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/samples/bpf/cpustat_user.c b/samples/bpf/cpustat_user.c
index ab90bb08a2b4..356f756cba0d 100644
--- a/samples/bpf/cpustat_user.c
+++ b/samples/bpf/cpustat_user.c
@@ -66,10 +66,10 @@ static void cpu_stat_print(void)
printf("CPU-%-6d ", j);
for (i = 0; i < MAX_CSTATE_ENTRIES; i++)
- printf("%-11ld ", data->cstate[i] / 1000000);
+ printf("%-11lu ", data->cstate[i] / 1000000);
for (i = 0; i < MAX_PSTATE_ENTRIES; i++)
- printf("%-11ld ", data->pstate[i] / 1000000);
+ printf("%-11lu ", data->pstate[i] / 1000000);
printf("\n");
}