mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-24 02:08:04 +00:00
HV: Avoiding the chained assignment
To follow the Misra C standard, doing one assignment per line to make code is clearly readable and reduces the confusion of its intetion or typo. Signed-off-by: Yang, Yu-chu <yu-chu.yang@intel.com>
This commit is contained in:
@@ -49,8 +49,8 @@ void acrn_update_ucode(struct vcpu *vcpu, uint64_t v)
|
||||
data_page_num =
|
||||
(data_size + CPU_PAGE_SIZE - 1) >> CPU_PAGE_SHIFT;
|
||||
|
||||
ptr = ucode_ptr = alloc_pages(data_page_num);
|
||||
if (ptr == NULL)
|
||||
ucode_ptr = alloc_pages(data_page_num);
|
||||
if (ucode_ptr == NULL)
|
||||
return;
|
||||
|
||||
err_code = 0U;
|
||||
@@ -62,7 +62,7 @@ void acrn_update_ucode(struct vcpu *vcpu, uint64_t v)
|
||||
return;
|
||||
|
||||
msr_write(MSR_IA32_BIOS_UPDT_TRIG,
|
||||
(uint64_t)ptr + sizeof(struct ucode_header));
|
||||
(uint64_t)ucode_ptr + sizeof(struct ucode_header));
|
||||
get_microcode_version();
|
||||
|
||||
free(ucode_ptr);
|
||||
|
@@ -327,11 +327,11 @@ vioapic_write(struct vioapic *vioapic, uint32_t addr, uint32_t data)
|
||||
else
|
||||
lshift = 0;
|
||||
|
||||
last = new = vioapic->rtbl[pin].reg;
|
||||
last = vioapic->rtbl[pin].reg;
|
||||
|
||||
data64 = (uint64_t)data << lshift;
|
||||
mask64 = (uint64_t)0xffffffff << lshift;
|
||||
new &= ~mask64 | RTBL_RO_BITS;
|
||||
new = last & (~mask64 | RTBL_RO_BITS);
|
||||
new |= data64 & ~RTBL_RO_BITS;
|
||||
|
||||
changed = last ^ new;
|
||||
|
@@ -101,7 +101,8 @@ int create_vm(struct vm_description *vm_desc, struct vm **rtn_vm)
|
||||
for (id = 0U; id < (size_t)(sizeof(long) * 8U); id++)
|
||||
if (!bitmap_test_and_set(id, &vmid_bitmap))
|
||||
break;
|
||||
vm->attr.id = vm->attr.boot_idx = id;
|
||||
vm->attr.id = id;
|
||||
vm->attr.boot_idx = id;
|
||||
|
||||
atomic_store(&vm->hw.created_vcpus, 0);
|
||||
|
||||
|
Reference in New Issue
Block a user