mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-21 16:57:20 +00:00
HV:fix simple violations
Fix the violations not touched the logical. 1.Function return value not checked. 2.Logical conjuctions need brackets. 3.No brackets to then/else. 4.Type conversion without cast. Tracked-On: #861 Signed-off-by: Huihuang Shi <huihuang.shi@intel.com>
This commit is contained in:
@@ -34,8 +34,9 @@ static uint8_t cmos_get_reg_val(uint8_t addr)
|
||||
spinlock_obtain(&cmos_lock);
|
||||
|
||||
/* Make sure an update isn't in progress */
|
||||
while (cmos_update_in_progress() && tries--)
|
||||
;
|
||||
while (cmos_update_in_progress() && (tries != 0)) {
|
||||
tries -= 1;
|
||||
}
|
||||
|
||||
reg = cmos_read(addr);
|
||||
|
||||
|
@@ -508,11 +508,13 @@ static struct acrn_vuart *find_active_target_vuart(struct vuart_config *vu_confi
|
||||
|
||||
target_vmid = vu_config->t_vuart.vm_id;
|
||||
target_vuid = vu_config->t_vuart.vuart_id;
|
||||
if (target_vmid < CONFIG_MAX_VM_NUM)
|
||||
if (target_vmid < CONFIG_MAX_VM_NUM) {
|
||||
target_vm = get_vm_from_vmid(target_vmid);
|
||||
}
|
||||
|
||||
if (target_vuid < MAX_VUART_NUM_PER_VM)
|
||||
if (target_vuid < MAX_VUART_NUM_PER_VM) {
|
||||
target_vu = &target_vm->vuart[target_vuid];
|
||||
}
|
||||
|
||||
if ((target_vu != NULL) && (target_vu->active)) {
|
||||
ret_vu = target_vu;
|
||||
|
Reference in New Issue
Block a user