HV: Remove goto in vlapic_read()
remove goto statement in vlapic_read() routine
Acked-by: Eddie Dong
@@ -1025,10 +1025,7 @@ vlapic_calcdest(struct acrn_vm *vm, uint64_t *dmask, uint32_t dest,
* Broadcast in both logical and physical modes.
*/
*dmask = vm_active_cpus(vm);
- return;
- }
-
- if (phys) {
+ } else if (phys) {
/*
* Physical mode: destination is LAPIC ID.
*/
@@ -1464,8 +1461,7 @@ vlapic_read(struct acrn_vlapic *vlapic, uint32_t offset_arg,
if (offset > sizeof(*lapic)) {
*data = 0UL;
- goto done;
- }
+ } else {
offset &= ~0x3UL;
switch (offset) {
@@ -1548,9 +1544,7 @@ vlapic_read(struct acrn_vlapic *vlapic, uint32_t offset_arg,
*data = vlapic_get_lvt(vlapic, offset);
#ifdef INVARIANTS
reg = vlapic_get_lvtptr(vlapic, offset);
- ASSERT(*data == *reg,
- "inconsistent lvt value at offset %#x: %#lx/%#x",
- offset, *data, *reg);
+ ASSERT(*data == *reg, "inconsistent lvt value at offset %#x: %#lx/%#x", offset, *data, *reg);
#endif
break;
case APIC_OFFSET_TIMER_ICR:
@@ -1572,7 +1566,8 @@ vlapic_read(struct acrn_vlapic *vlapic, uint32_t offset_arg,
*data = 0UL;
break;
}
-done:
+ }
+
dev_dbg(ACRN_DBG_LAPIC,
"vlapic read offset %#x, data %#lx", offset, *data);
return 0;
