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 <jason.cj.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Jason Chen CJ 2018-04-05 06:56:49 +08:00 committed by Jack Ren
parent fa3e424fcf
commit 6454c7be6b
1 changed files with 3 additions and 2 deletions

View File

@ -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;
}
}