diff --git a/hypervisor/arch/x86/cpu_caps.c b/hypervisor/arch/x86/cpu_caps.c index 4eda71089..aa13c0bfb 100644 --- a/hypervisor/arch/x86/cpu_caps.c +++ b/hypervisor/arch/x86/cpu_caps.c @@ -330,6 +330,8 @@ static int32_t check_vmx_mmu_cap(void) } else if (!cpu_has_vmx_ept_cap(VMX_EPT_1GB_PAGE)) { pr_fatal("%s, ept not support 1GB large page\n", __func__); ret = -ENODEV; + } else { + /* No other state currently, do nothing */ } return ret; diff --git a/hypervisor/arch/x86/guest/instr_emul.c b/hypervisor/arch/x86/guest/instr_emul.c index 164022e5f..d11f7bc9e 100644 --- a/hypervisor/arch/x86/guest/instr_emul.c +++ b/hypervisor/arch/x86/guest/instr_emul.c @@ -430,6 +430,8 @@ static uint64_t vm_get_register(const struct acrn_vcpu *vcpu, enum cpu_reg_name } else { reg_val = (uint64_t)exec_vmread16(field); } + } else { + /* No other state currently, do nothing */ } return reg_val; @@ -457,6 +459,8 @@ static void vm_set_register(struct acrn_vcpu *vcpu, enum cpu_reg_name reg, } else { exec_vmwrite16(field, (uint16_t)val); } + } else { + /* No other state currently, do nothing */ } } diff --git a/hypervisor/arch/x86/guest/pm.c b/hypervisor/arch/x86/guest/pm.c index 16d9cc3d0..54e3d4c55 100644 --- a/hypervisor/arch/x86/guest/pm.c +++ b/hypervisor/arch/x86/guest/pm.c @@ -177,6 +177,8 @@ static bool pm1ab_io_write(struct acrn_vm *vm, uint16_t addr, size_t width, uint } to_write = false; + } else { + /* No other state currently, do nothing */ } } diff --git a/hypervisor/arch/x86/guest/vlapic.c b/hypervisor/arch/x86/guest/vlapic.c index d9575446b..2b6398ebc 100644 --- a/hypervisor/arch/x86/guest/vlapic.c +++ b/hypervisor/arch/x86/guest/vlapic.c @@ -1132,6 +1132,8 @@ vlapic_calc_dest(struct acrn_vm *vm, uint64_t *dmask, uint32_t dest, bool phys, lowprio_dest = vlapic; } else if (lowprio_dest->apic_page.ppr.v > vlapic->apic_page.ppr.v) { lowprio_dest = vlapic; + } else { + /* No other state currently, do nothing */ } } else { bitmap_set_nolock(vcpu_id, dmask); @@ -1782,6 +1784,8 @@ vlapic_set_apicbase(struct acrn_vlapic *vlapic, uint64_t new) "NOT support to change APIC_BASE MSR from %#lx to %#lx", vlapic->msr_apicbase, new); ret = -1; + } else { + /* No other state currently, do nothing */ } return ret; diff --git a/hypervisor/arch/x86/security.c b/hypervisor/arch/x86/security.c index 8b2a90929..b0905d101 100644 --- a/hypervisor/arch/x86/security.c +++ b/hypervisor/arch/x86/security.c @@ -66,6 +66,8 @@ bool check_cpu_security_cap(void) } else if ((!cpu_has_cap(X86_FEATURE_IBRS_IBPB)) && (!cpu_has_cap(X86_FEATURE_STIBP))) { ret = false; + } else { + /* No other state currently, do nothing */ } } else { ret = false; diff --git a/hypervisor/debug/dbg_cmd.c b/hypervisor/debug/dbg_cmd.c index f23e58ee4..287ab4582 100644 --- a/hypervisor/debug/dbg_cmd.c +++ b/hypervisor/debug/dbg_cmd.c @@ -67,6 +67,8 @@ bool handle_dbg_cmd(const char *cmd, int32_t len) uart16550_set_property(true, false, (uint64_t)(cmd+tmp)); } else if (i == IDX_SET_VUART) { vuart_set_property(cmd+tmp); + } else { + /* No other state currently, do nothing */ } } diff --git a/hypervisor/debug/npk_log.c b/hypervisor/debug/npk_log.c index bc2947a83..e25946dbe 100644 --- a/hypervisor/debug/npk_log.c +++ b/hypervisor/debug/npk_log.c @@ -64,6 +64,8 @@ static inline int32_t npk_write(const char *value, void *addr, size_t sz) } else if (sz >= 1U) { mmio_write8(*(uint8_t *)value, addr); ret = 1; + } else { + /* No other state currently, do nothing */ } return ret; diff --git a/hypervisor/debug/shell.c b/hypervisor/debug/shell.c index ed99921f0..ef45df383 100644 --- a/hypervisor/debug/shell.c +++ b/hypervisor/debug/shell.c @@ -398,6 +398,8 @@ static int32_t shell_process_cmd(const char *p_input_line) shell_puts("\r\nError: Invalid parameters.\r\n"); } else if (status != 0) { shell_puts("\r\nCommand launch failed.\r\n"); + } else { + /* No other state currently, do nothing */ } } diff --git a/hypervisor/dm/vpci/vmsix.c b/hypervisor/dm/vpci/vmsix.c index 271109cdd..e92cbf6ce 100644 --- a/hypervisor/dm/vpci/vmsix.c +++ b/hypervisor/dm/vpci/vmsix.c @@ -326,6 +326,8 @@ static int32_t vmsix_table_mmio_access_handler(struct io_request *io_req, void * } } clac(); + } else { + /* No other state currently, do nothing */ } }