sophgo / linux-riscv

Linux kernel stable tree
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
Other
25 stars 52 forks source link

perf cpumap: Make counter as unsigned ints #78

Closed RevySR closed 10 months ago

RevySR commented 10 months ago

These are loop counters which is inherently unsigned. Therefore make them unsigned. Moreover it also fixes alloc-size-larger-than error with gcc-13, where malloc can be called with (-1) due to tmp_len being an int type.

Fixes | cpumap.c:366:20: error: argument 1 range [18446744065119617024, 18446744073709551612] exceeds maximum object size 9223372036854775807 [-Werror=alloc-size-larger-than=] | 366 | tmp_cpus = malloc(tmp_len * sizeof(struct perf_cpu)); | | ^~~~~~~~~

refer: https://www.spinics.net/lists/linux-perf-users/msg25755.html patch: https://git.yoctoproject.org/poky/plain/meta/recipes-kernel/linux/files/0001-perf-cpumap-Make-counter-as-unsigned-ints.patch

RevySR commented 10 months ago

failed log: https://github.com/revyos/sg2042-linux-kernel/actions/runs/6771229809/job/18401208011