[PATCH] samples/bpf:Fix the wrong format specifier

Zhu Jun posted 1 patch 1 year, 5 months ago
samples/bpf/map_perf_test_user.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] samples/bpf:Fix the wrong format specifier
Posted by Zhu Jun 1 year, 5 months ago
The format specifier of "int" in printf() should be "%d", not
"%u"

Signed-off-by: Zhu Jun <zhujun2@cmss.chinamobile.com>
---
 samples/bpf/map_perf_test_user.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/samples/bpf/map_perf_test_user.c b/samples/bpf/map_perf_test_user.c
index 07ff471ed6ae..dc27057c7dc1 100644
--- a/samples/bpf/map_perf_test_user.c
+++ b/samples/bpf/map_perf_test_user.c
@@ -159,7 +159,7 @@ static void do_test_lru(enum test_type test, int cpu)
 					  &inner_lru_map_fds[cpu],
 					  BPF_ANY);
 		if (ret) {
-			printf("cannot update ARRAY_OF_LRU_HASHS with key:%u. %s(%d)\n",
+			printf("cannot update ARRAY_OF_LRU_HASHS with key:%d. %s(%d)\n",
 			       cpu, strerror(errno), errno);
 			exit(1);
 		}
-- 
2.17.1
Re: [PATCH] samples/bpf:Fix the wrong format specifier
Posted by Yonghong Song 1 year, 5 months ago
On 8/20/24 1:10 AM, Zhu Jun wrote:
> The format specifier of "int" in printf() should be "%d", not
> "%u"
>
> Signed-off-by: Zhu Jun <zhujun2@cmss.chinamobile.com>

Acked-by: Yonghong Song <yonghong.song@linux.dev>