kernel_samsung_a53x/tools/bpf/bpftool
Tiezhu Yang 2666ae962d bpftool: Silence build warning about calloc()
[ Upstream commit f5f30386c78105cba520e443a6a9ee945ec1d066 ]

There exists the following warning when building bpftool:

  CC      prog.o
prog.c: In function ‘profile_open_perf_events’:
prog.c:2301:24: warning: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Wcalloc-transposed-args]
 2301 |                 sizeof(int), obj->rodata->num_cpu * obj->rodata->num_metric);
      |                        ^~~
prog.c:2301:24: note: earlier argument should specify number of elements, later size of each element

Tested with the latest upstream GCC which contains a new warning option
-Wcalloc-transposed-args. The first argument to calloc is documented to
be number of elements in array, while the second argument is size of each
element, just switch the first and second arguments of calloc() to silence
the build warning, compile tested only.

Fixes: 47c09d6a9f67 ("bpftool: Introduce "prog profile" command")
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Quentin Monnet <quentin@isovalent.com>
Link: https://lore.kernel.org/bpf/20240116061920.31172-1-yangtiezhu@loongson.cn
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 08:44:39 +01:00
..
bash-completion Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Documentation Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
skeleton Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
btf.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
btf_dumper.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cfg.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cfg.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cgroup.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
common.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
feature.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
gen.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
iter.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
jit_disasm.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
json_writer.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
json_writer.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
link.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
main.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
main.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
map.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
map_perf_ring.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
net.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
netlink_dumper.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
netlink_dumper.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
perf.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pids.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
prog.c bpftool: Silence build warning about calloc() 2024-11-19 08:44:39 +01:00
struct_ops.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tracelog.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xlated_dumper.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xlated_dumper.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00