From 6454c7be6bf27931439b1e649c0c38f2aed75262 Mon Sep 17 00:00:00 2001 From: Jason Chen CJ Date: Thu, 5 Apr 2018 06:56:49 +0800 Subject: [PATCH] mmu: refine function map_mem_region function map_mem_region should return mapped_size, if something wrong, it return 0. the change is valid for release version, as at that time ASSERT() in map_mem_region is empty. Signed-off-by: Jason Chen CJ Acked-by: Eddie Dong --- hypervisor/arch/x86/mmu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hypervisor/arch/x86/mmu.c b/hypervisor/arch/x86/mmu.c index 3c2b367ff..e13517f30 100644 --- a/hypervisor/arch/x86/mmu.c +++ b/hypervisor/arch/x86/mmu.c @@ -173,6 +173,7 @@ static uint32_t map_mem_region(void *vaddr, void *paddr, || request_type >= PAGING_REQUEST_TYPE_UNKNOWN) { /* Shouldn't go here */ ASSERT(false, "Incorrect Arguments. Failed to map region"); + return 0; } /* switch based on of table */ @@ -280,8 +281,8 @@ static uint32_t map_mem_region(void *vaddr, void *paddr, break; } default: - ASSERT("Bad memory map request type" == 0, ""); - break; + ASSERT(0, "Bad memory map request type"); + return 0; } }