diff options
author | qhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-09-17 13:28:05 +0000 |
---|---|---|
committer | qhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-09-17 13:28:05 +0000 |
commit | d45fd260267ee70c093519eb1e4a1ef285549e85 (patch) | |
tree | 55050c8b5f590f4359f3b35766e232e0b3c688c8 /MdeModulePkg | |
parent | 04b9f7631327ef09701b9ff7a86d53fa51a70b50 (diff) | |
download | edk2-d45fd260267ee70c093519eb1e4a1ef285549e85.zip edk2-d45fd260267ee70c093519eb1e4a1ef285549e85.tar.gz edk2-d45fd260267ee70c093519eb1e4a1ef285549e85.tar.bz2 |
Fix several code review minor comments:
1.Line 1520, 1525, 1530:Use goto to save Release Lock
2.Line 224: Do not use DEBUG_ERROR, since it is not an error case
3.Scrub the DEBUG () print statement to add DEBUG_PAGE
4.Line 20: Typo of "help cooalese"
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5915 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r-- | MdeModulePkg/Core/Dxe/Mem/Page.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/MdeModulePkg/Core/Dxe/Mem/Page.c b/MdeModulePkg/Core/Dxe/Mem/Page.c index b09f2f1..aeaa48d 100644 --- a/MdeModulePkg/Core/Dxe/Mem/Page.c +++ b/MdeModulePkg/Core/Dxe/Mem/Page.c @@ -17,7 +17,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #define EFI_DEFAULT_PAGE_ALLOCATION_ALIGNMENT (EFI_PAGE_SIZE)
//
-// Entry for tracking the memory regions for each memory type to help cooalese like memory types
+// Entry for tracking the memory regions for each memory type to coalesce similar memory types
//
typedef struct {
EFI_PHYSICAL_ADDRESS BaseAddress;
@@ -221,7 +221,7 @@ PromoteMemoryResource ( LIST_ENTRY *Link;
EFI_GCD_MAP_ENTRY *Entry;
- DEBUG ((DEBUG_ERROR | DEBUG_PAGE, "Promote the memory resource\n"));
+ DEBUG ((DEBUG_PAGE, "Promote the memory resource\n"));
CoreAcquireGcdMemoryLock ();
@@ -754,7 +754,7 @@ CoreConvertPages ( // Debug code - verify conversion is allowed
//
if (!(NewType == EfiConventionalMemory ? 1 : 0) ^ (Entry->Type == EfiConventionalMemory ? 1 : 0)) {
- DEBUG ((DEBUG_ERROR , "ConvertPages: Incompatible memory types\n"));
+ DEBUG ((DEBUG_ERROR | DEBUG_PAGE, "ConvertPages: Incompatible memory types\n"));
return EFI_NOT_FOUND;
}
@@ -1516,19 +1516,19 @@ CoreTerminateMemoryMap ( Entry = CR(Link, MEMORY_MAP, Link, MEMORY_MAP_SIGNATURE);
if (Entry->Attribute & EFI_MEMORY_RUNTIME) {
if (Entry->Type == EfiACPIReclaimMemory || Entry->Type == EfiACPIMemoryNVS) {
- DEBUG((DEBUG_ERROR, "ExitBootServices: ACPI memory entry has RUNTIME attribute set.\n"));
- CoreReleaseMemoryLock ();
- return EFI_INVALID_PARAMETER;
+ DEBUG((DEBUG_ERROR | DEBUG_PAGE, "ExitBootServices: ACPI memory entry has RUNTIME attribute set.\n"));
+ Status = EFI_INVALID_PARAMETER;
+ goto Done;
}
if (Entry->Start & (EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT - 1)) {
- DEBUG((DEBUG_ERROR, "ExitBootServices: A RUNTIME memory entry is not on a proper alignment.\n"));
- CoreReleaseMemoryLock ();
- return EFI_INVALID_PARAMETER;
+ DEBUG((DEBUG_ERROR | DEBUG_PAGE, "ExitBootServices: A RUNTIME memory entry is not on a proper alignment.\n"));
+ Status = EFI_INVALID_PARAMETER;
+ goto Done;
}
if ((Entry->End + 1) & (EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT - 1)) {
- DEBUG((DEBUG_ERROR, "ExitBootServices: A RUNTIME memory entry is not on a proper alignment.\n"));
- CoreReleaseMemoryLock ();
- return EFI_INVALID_PARAMETER;
+ DEBUG((DEBUG_ERROR | DEBUG_PAGE, "ExitBootServices: A RUNTIME memory entry is not on a proper alignment.\n"));
+ Status = EFI_INVALID_PARAMETER;
+ goto Done;
}
}
}
@@ -1544,6 +1544,7 @@ CoreTerminateMemoryMap ( Status = EFI_INVALID_PARAMETER;
}
+Done:
CoreReleaseMemoryLock ();
return Status;
|