mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-01-05 15:45:05 +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:
@@ -168,8 +168,9 @@ static struct acpi_table_rsdp *get_rsdp(void)
|
||||
rsdp = found_rsdp((char *)hpa2hva(0xe0000UL), 0x20000);
|
||||
}
|
||||
|
||||
if (rsdp == NULL)
|
||||
if (rsdp == NULL) {
|
||||
panic("No RSDP is found");
|
||||
}
|
||||
|
||||
/* After RSDP is parsed, it will be assigned to acpi_rsdp */
|
||||
acpi_rsdp = rsdp;
|
||||
|
||||
@@ -298,7 +298,7 @@ static int32_t depri_boot_sw_loader(struct acrn_vm *vm)
|
||||
* We copy the info saved in depri_boot to boot_context and
|
||||
* init bsp with boot_context.
|
||||
*/
|
||||
memcpy_s(&(vcpu_regs->gprs), sizeof(struct acrn_gp_regs),
|
||||
(void)memcpy_s(&(vcpu_regs->gprs), sizeof(struct acrn_gp_regs),
|
||||
&(depri_boot_ctx->vcpu_regs.gprs), sizeof(struct acrn_gp_regs));
|
||||
|
||||
vcpu_regs->rip = depri_boot_ctx->vcpu_regs.rip;
|
||||
|
||||
Reference in New Issue
Block a user