perf cpumap: Make counter as unsigned ints
authorKhem Raj <raj.khem@gmail.com>
Mon, 23 Jan 2023 21:04:10 +0000 (13:04 -0800)
committerJaehoon Chung <jh80.chung@samsung.com>
Mon, 24 Jul 2023 23:25:19 +0000 (08:25 +0900)
commit7f643c2f4cb6ce9b1eb038f924d0f2ca63b5db2b
tree42dafbc3f43b87b543a834000e7319bbba2aaa5a
parent2a7c0b8fdb6737c9feb192976113e075add74ae0
perf cpumap: Make counter as unsigned ints

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 [1844674406511961702418446744073709551612] exceeds maximum object size 9223372036854775807 [-Werror=alloc-size-larger-than=]
|   366 |         tmp_cpus = malloc(tmp_len * sizeof(struct perf_cpu));
|       |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Upstream-Status: Submitted [https://lore.kernel.org/linux-perf-users/20230123211310.127532-1-raj.khem@gmail.com/T/#u]

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Change-Id: I7ecc661339efd49179dd4c1823f4969cee0b0515
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
tools/lib/perf/cpumap.c