mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-01-05 15:45:05 +00:00
hv: avoid using of mixed mode arithmetic
Avoid using of mixed mode arithmetic by using explicit casts Tracked-On: #861 Signed-off-by: Li, Fei1 <fei1.li@intel.com>
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
int validate_pstate(const struct acrn_vm *vm, uint64_t perf_ctl)
|
||||
{
|
||||
const struct cpu_px_data *px_data;
|
||||
int i, px_cnt;
|
||||
uint8_t i, px_cnt;
|
||||
|
||||
if (is_vm0(vm)) {
|
||||
return 0;
|
||||
@@ -18,11 +18,11 @@ int validate_pstate(const struct acrn_vm *vm, uint64_t perf_ctl)
|
||||
px_cnt = vm->pm.px_cnt;
|
||||
px_data = vm->pm.px_data;
|
||||
|
||||
if ((px_cnt == 0) || (px_data == NULL)) {
|
||||
if ((px_cnt == 0U) || (px_data == NULL)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
for (i = 0; i < px_cnt; i++) {
|
||||
for (i = 0U; i < px_cnt; i++) {
|
||||
if ((px_data + i)->control == (perf_ctl & 0xffffUL)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user