diff --git a/hypervisor/common/hypercall.c b/hypervisor/common/hypercall.c index 6fc18a671..f2b6cc92c 100644 --- a/hypervisor/common/hypercall.c +++ b/hypervisor/common/hypercall.c @@ -1096,9 +1096,7 @@ int32_t hcall_get_cpu_pm_state(struct acrn_vcpu *vcpu, struct acrn_vm *target_vm if (is_created_vm(target_vm)) { switch (cmd & PMCMD_TYPE_MASK) { case ACRN_PMCMD_GET_PX_CNT: { - if (target_vm->pm.px_cnt != 0U) { - ret = copy_to_gpa(vm, &(target_vm->pm.px_cnt), param2, sizeof(target_vm->pm.px_cnt)); - } + ret = copy_to_gpa(vm, &(target_vm->pm.px_cnt), param2, sizeof(target_vm->pm.px_cnt)); break; } case ACRN_PMCMD_GET_PX_DATA: { @@ -1123,9 +1121,7 @@ int32_t hcall_get_cpu_pm_state(struct acrn_vcpu *vcpu, struct acrn_vm *target_vm break; } case ACRN_PMCMD_GET_CX_CNT: { - if (target_vm->pm.cx_cnt != 0U) { - ret = copy_to_gpa(vm, &(target_vm->pm.cx_cnt), param2, sizeof(target_vm->pm.cx_cnt)); - } + ret = copy_to_gpa(vm, &(target_vm->pm.cx_cnt), param2, sizeof(target_vm->pm.cx_cnt)); break; } case ACRN_PMCMD_GET_CX_DATA: {