mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-15 05:49:17 +00:00
HV: Remove unnecessary vm0 check in vm0 specific func
Function prepare_vm0_memmap_and_e820 and init_vm0_boot_info are specific for vm0. There is no need to check is_vm0 again in those functions. This patch remove the unnecssary checks. v1 -> v2: - Add pre-condition comment before the function as Junjie's suggestion. Signed-off-by: Kaige Fu <kaige.fu@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -103,16 +103,20 @@ static void *get_kernel_load_addr(void *kernel_src_addr)
|
||||
return kernel_src_addr;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param[inout] vm pointer to a vm descriptor
|
||||
*
|
||||
* @return 0 - on success
|
||||
* @return -EINVAL - on invalid parameters
|
||||
*
|
||||
* @pre vm != NULL
|
||||
* @pre is_vm0(vm) == true
|
||||
*/
|
||||
int init_vm0_boot_info(struct vm *vm)
|
||||
{
|
||||
struct multiboot_module *mods = NULL;
|
||||
struct multiboot_info *mbi = NULL;
|
||||
|
||||
if (!is_vm0(vm)) {
|
||||
pr_err("just for vm0 to get info!");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (boot_regs[0] != MULTIBOOT_INFO_MAGIC) {
|
||||
ASSERT(false, "no multiboot info found");
|
||||
return -EINVAL;
|
||||
|
Reference in New Issue
Block a user