]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
libperf: Document code simplification case for widening struct perf_cpu
authorArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 8 Jun 2026 18:32:32 +0000 (15:32 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 10 Jun 2026 18:23:54 +0000 (15:23 -0300)
commit7435c4069a546a5d2421407b3d43fdc1790ce6cc
tree409c0d87050bfb5804a8b72c382cd49001a875b7
parente33711d5e757011bb6d3506af4d6c97dad412b8f
libperf: Document code simplification case for widening struct perf_cpu

Add a bullet point to the libperf ABI TODO explaining the code
simplification benefit of widening struct perf_cpu.cpu from int16_t
to int: the narrow type forces defensive truncation checks at every
boundary where wider CPU indices are narrowed, and values > 32767
silently wrap to negative numbers (two's complement), bypassing
bounds validation without them.

Acked-by: Ian Rogers <irogers@google.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Assisted-by: Claude:claude-opus-4.6
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/lib/perf/TODO