From d276381bc095c09aead0b09704d947860dc55ef2 Mon Sep 17 00:00:00 2001
From: Star Zeng <star.zeng@intel.com>
Date: Thu, 28 May 2015 18:22:24 +0800
Subject: [PATCH] MdeModulePkg/DxeCore: Fixed build error.

ARM toolchain raises the build error: "enumerated type mixed with
another type".

To fix the issue, typecase can be used like below.
 -    return EfiMaxMemoryType + 1;
 +    return (EFI_MEMORY_TYPE)(EfiMaxMemoryType + 1);

But to eliminate the confusion, update the return type of
GetProfileMemoryIndex() from EFI_MEMORY_TYPE or UINTN.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
---
 Core/Dxe/Mem/MemoryProfileRecord.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Core/Dxe/Mem/MemoryProfileRecord.c b/Core/Dxe/Mem/MemoryProfileRecord.c
index 2c6713f..1f17947 100644
--- a/Core/Dxe/Mem/MemoryProfileRecord.c
+++ b/Core/Dxe/Mem/MemoryProfileRecord.c
@@ -778,10 +778,10 @@ CoreNeedRecordProfile (
 
   @param MemoryType     Memory type.
 
-  @return EFI memory type as profile memory index.
+  @return Profile memory index.
 
 **/
-EFI_MEMORY_TYPE
+UINTN
 GetProfileMemoryIndex (
   IN EFI_MEMORY_TYPE    MemoryType
   )
@@ -824,7 +824,7 @@ CoreUpdateProfileAllocate (
   MEMORY_PROFILE_CONTEXT_DATA       *ContextData;
   MEMORY_PROFILE_DRIVER_INFO_DATA   *DriverInfoData;
   MEMORY_PROFILE_ALLOC_INFO_DATA    *AllocInfoData;
-  EFI_MEMORY_TYPE                   ProfileMemoryIndex;
+  UINTN                             ProfileMemoryIndex;
 
   AllocInfoData = NULL;
 
@@ -977,7 +977,7 @@ CoreUpdateProfileFree (
   LIST_ENTRY                       *DriverInfoList;
   MEMORY_PROFILE_DRIVER_INFO_DATA  *ThisDriverInfoData;
   MEMORY_PROFILE_ALLOC_INFO_DATA   *AllocInfoData;
-  EFI_MEMORY_TYPE                  ProfileMemoryIndex;
+  UINTN                            ProfileMemoryIndex;
 
   ContextData = GetMemoryProfileContext ();
   if (ContextData == NULL) {
-- 
1.9.5.msysgit.0

