mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-23 17:58:30 +00:00
HV: Moving operators out from conditions
To follow the Misra-c standard, any operators should be done outside the conditions. Removed the prefix, postfix and bitwise shift from conditions. Signed-off-by: Yang, Yu-chu <yu-chu.yang@intel.com>
This commit is contained in:
@@ -1107,7 +1107,8 @@ vlapic_icrlo_write_handler(struct vlapic *vlapic)
|
||||
"Sending SIPI from VCPU %d to %hu with vector %d",
|
||||
vlapic->vcpu->vcpu_id, vcpu_id, vec);
|
||||
|
||||
if (--target_vcpu->arch_vcpu.nr_sipi > 0)
|
||||
target_vcpu->arch_vcpu.nr_sipi--;
|
||||
if (target_vcpu->arch_vcpu.nr_sipi > 0)
|
||||
continue;
|
||||
|
||||
target_vcpu->arch_vcpu.cpu_mode = CPU_MODE_REAL;
|
||||
|
@@ -191,7 +191,8 @@ void timer_softirq(uint16_t pcpu_id)
|
||||
list_for_each_safe(pos, n, &cpu_timer->timer_list) {
|
||||
timer = list_entry(pos, struct timer, node);
|
||||
/* timer expried */
|
||||
if (timer->fire_tsc <= current_tsc && --tries > 0) {
|
||||
tries--;
|
||||
if (timer->fire_tsc <= current_tsc && tries > 0) {
|
||||
del_timer(timer);
|
||||
|
||||
run_timer(timer);
|
||||
|
@@ -1167,10 +1167,11 @@ void suspend_iommu(void)
|
||||
/* If the number of real iommu devices is larger than we
|
||||
* defined in kconfig.
|
||||
*/
|
||||
if (iommu_idx++ > CONFIG_MAX_IOMMU_NUM) {
|
||||
if (iommu_idx > CONFIG_MAX_IOMMU_NUM) {
|
||||
pr_err("iommu dev number is larger than pre-defined");
|
||||
break;
|
||||
}
|
||||
iommu_idx++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1206,10 +1207,11 @@ void resume_iommu(void)
|
||||
/* If the number of real iommu devices is larger than we
|
||||
* defined in kconfig.
|
||||
*/
|
||||
if (iommu_idx++ > CONFIG_MAX_IOMMU_NUM) {
|
||||
if (iommu_idx > CONFIG_MAX_IOMMU_NUM) {
|
||||
pr_err("iommu dev number is larger than pre-defined");
|
||||
break;
|
||||
}
|
||||
iommu_idx++;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user