mirror of
https://github.com/torvalds/linux
synced 2024-11-05 18:23:50 +00:00
6a8faf1070
Quentin reported build warnings when building bpftool :
link.c: In function ‘perf_config_hw_cache_str’:
link.c:86:18: warning: comparison of unsigned expression in ‘>= 0’ is always true [-Wtype-limits]
86 | if ((id) >= 0 && (id) < ARRAY_SIZE(array)) \
| ^~
link.c:320:20: note: in expansion of macro ‘perf_event_name’
320 | hw_cache = perf_event_name(evsel__hw_cache, config & 0xff);
| ^~~~~~~~~~~~~~~
[... more of the same for the other calls to perf_event_name ...]
He also pointed out the reason and the solution:
We're always passing unsigned, so it should be safe to drop the check on
(id) >= 0.
Fixes:
|
||
---|---|---|
.. | ||
bash-completion | ||
Documentation | ||
skeleton | ||
.gitignore | ||
btf.c | ||
btf_dumper.c | ||
cfg.c | ||
cfg.h | ||
cgroup.c | ||
common.c | ||
feature.c | ||
gen.c | ||
iter.c | ||
jit_disasm.c | ||
json_writer.c | ||
json_writer.h | ||
link.c | ||
main.c | ||
main.h | ||
Makefile | ||
map.c | ||
map_perf_ring.c | ||
net.c | ||
netlink_dumper.c | ||
netlink_dumper.h | ||
perf.c | ||
pids.c | ||
prog.c | ||
struct_ops.c | ||
tracelog.c | ||
xlated_dumper.c | ||
xlated_dumper.h |