]> git.ipfire.org Git - thirdparty/linux.git/commit
libperf cpumap: Make index and nr types unsigned
authorIan Rogers <irogers@google.com>
Tue, 31 Mar 2026 18:29:48 +0000 (11:29 -0700)
committerNamhyung Kim <namhyung@kernel.org>
Wed, 1 Apr 2026 21:50:53 +0000 (14:50 -0700)
commit83c338369a88eeab8cc64446c7ba9bb8ffb37e4a
treebdd47dab3a86b631d4d4d882eb69a8c9b7ce3fb1
parent7f8969aa739da4d2096f2e6f87e030de6efad9dc
libperf cpumap: Make index and nr types unsigned

The index into the cpumap array and the number of entries within the
array can never be negative, so let's make them unsigned. This is
prompted by reports that gcc 13 with -O6 is giving a
alloc-size-larger-than errors. The change makes the cpumap changes and
then updates the declaration of index variables throughout perf and
libperf to be unsigned. The two things are hard to separate as
compiler warnings about mixing signed and unsigned types breaks the
build.

Reported-by: Chingbin Li <liqb365@163.com>
Closes: https://lore.kernel.org/lkml/20260212025127.841090-1-liqb365@163.com/
Tested-by: Chingbin Li <liqb365@163.com>
Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
34 files changed:
tools/lib/perf/cpumap.c
tools/lib/perf/evsel.c
tools/lib/perf/include/internal/cpumap.h
tools/lib/perf/include/perf/cpumap.h
tools/perf/arch/arm/util/cs-etm.c
tools/perf/arch/arm64/util/arm-spe.c
tools/perf/arch/arm64/util/header.c
tools/perf/arch/x86/util/pmu.c
tools/perf/builtin-c2c.c
tools/perf/builtin-record.c
tools/perf/builtin-script.c
tools/perf/builtin-stat.c
tools/perf/tests/bitmap.c
tools/perf/tests/cpumap.c
tools/perf/tests/mem2node.c
tools/perf/tests/openat-syscall-all-cpus.c
tools/perf/tests/topology.c
tools/perf/util/affinity.c
tools/perf/util/bpf_counter.c
tools/perf/util/bpf_counter_cgroup.c
tools/perf/util/bpf_kwork.c
tools/perf/util/bpf_kwork_top.c
tools/perf/util/bpf_off_cpu.c
tools/perf/util/bpf_trace_augment.c
tools/perf/util/cpumap.c
tools/perf/util/cputopo.c
tools/perf/util/env.c
tools/perf/util/scripting-engines/trace-event-python.c
tools/perf/util/session.c
tools/perf/util/stat-display.c
tools/perf/util/stat.c
tools/perf/util/svghelper.c
tools/perf/util/symbol.c
tools/perf/util/synthetic-events.c