util: kernel: Fix to return valid result on getting cpu stat 83/279983/3
authorDongwoo Lee <dwoo08.lee@samsung.com>
Fri, 19 Aug 2022 10:03:59 +0000 (19:03 +0900)
committerDongwoo Lee <dwlee08@gmail.com>
Tue, 23 Aug 2022 00:04:34 +0000 (17:04 -0700)
commit744ff5034b204b9188acc4effd9bcb0442bc9e62
tree6a5692d2a8e1fcea9bde341f3285eca36092b809
parent3104878c229f0fc9932ea920c8a9f7a7454b5314
util: kernel: Fix to return valid result on getting cpu stat

In the case of the target which supports cpu hotplug, the number of
possible online cpus can be changed and thus __get_cpu_stat can be
failed for offline cpus. At worst case if the last __get_cpu_stat is
resulted in negative, kernel_get_per_cpu_stat can return error even
though it is not actual failure. To prevent this situation, this
ignores the case that __get_cpu_stat returns failure.

Change-Id: I5d33e740b2451e7c644b407c1f92785a1e570585
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
src/util/kernel.c