linux-stable/tools/lib
Matteo Croce 68c4dd2088 libbpf: Fix warning in calloc() usage
[ Upstream commit 0ee30d937c ]

When compiling libbpf with some compilers, this warning is triggered:

libbpf.c: In function ‘bpf_object__gen_loader’:
libbpf.c:9209:28: error: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
 9209 |         gen = calloc(sizeof(*gen), 1);
      |                            ^
libbpf.c:9209:28: note: earlier argument should specify number of elements, later size of each element

Fix this by inverting the calloc() arguments.

Signed-off-by: Matteo Croce <teknoraver@meta.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Yonghong Song <yonghong.song@linux.dev>
Link: https://lore.kernel.org/bpf/20250717200337.49168-1-technoboy85@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-08-20 18:41:07 +02:00
..
api libapi: Add missing header with NAME_MAX define to io_dir.h 2025-03-13 00:29:36 -07:00
bpf libbpf: Fix warning in calloc() usage 2025-08-20 18:41:07 +02:00
perf libperf threadmap: Add perf_thread_map__idx() 2025-05-21 15:07:13 -03:00
subcmd tools subcmd: Tighten the filename size in check_if_command_finished 2025-08-15 16:39:11 +02:00
symbol
thermal tools: Remove redundant quiet setup 2025-02-18 16:27:43 -03:00
argv_split.c
bitmap.c lib/interval_tree: add test case for interval_tree_iter_xxx() helpers 2025-03-17 12:17:00 -07:00
cmdline.c
ctype.c
find_bit.c
hweight.c
list_sort.c
rbtree.c
slab.c lib/rbtree: enable userland test suite for rbtree related data structure 2025-03-17 12:17:00 -07:00
str_error_r.c
string.c
vsprintf.c
zalloc.c