diff options
author | rsun3 <rsun3@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-05-17 08:32:05 +0000 |
---|---|---|
committer | rsun3 <rsun3@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-05-17 08:32:05 +0000 |
commit | f0c855b26386c16ba0a70600d72cd09c090db0e0 (patch) | |
tree | 14527b04cad3e48d713e7577f02a595eb7b1b1b2 /MdeModulePkg/Universal | |
parent | 0e4483bc69aa31f1facbe62af438fa4feaf4503a (diff) | |
download | edk2-f0c855b26386c16ba0a70600d72cd09c090db0e0.zip edk2-f0c855b26386c16ba0a70600d72cd09c090db0e0.tar.gz edk2-f0c855b26386c16ba0a70600d72cd09c090db0e0.tar.bz2 |
Small code refinement in MdeModulePkg.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10492 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal')
4 files changed, 70 insertions, 89 deletions
diff --git a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c index bd926d3..23117b1 100644 --- a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c +++ b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c @@ -719,61 +719,59 @@ AddTableToList ( //
// Update pointers in FADT. If tables don't exist this will put NULL pointers there.
//
- if (AcpiTableInstance->Fadt3 != NULL) {
- AcpiTableInstance->Fadt3->FirmwareCtrl = (UINT32) (UINTN) AcpiTableInstance->Facs3;
- Buffer64 = (UINT64) (UINTN) AcpiTableInstance->Facs3;
- CopyMem (
- &AcpiTableInstance->Fadt3->XFirmwareCtrl,
- &Buffer64,
- sizeof (UINT64)
- );
- AcpiTableInstance->Fadt3->Dsdt = (UINT32) (UINTN) AcpiTableInstance->Dsdt3;
- Buffer64 = (UINT64) (UINTN) AcpiTableInstance->Dsdt3;
- CopyMem (
- &AcpiTableInstance->Fadt3->XDsdt,
- &Buffer64,
- sizeof (UINT64)
- );
+ AcpiTableInstance->Fadt3->FirmwareCtrl = (UINT32) (UINTN) AcpiTableInstance->Facs3;
+ Buffer64 = (UINT64) (UINTN) AcpiTableInstance->Facs3;
+ CopyMem (
+ &AcpiTableInstance->Fadt3->XFirmwareCtrl,
+ &Buffer64,
+ sizeof (UINT64)
+ );
+ AcpiTableInstance->Fadt3->Dsdt = (UINT32) (UINTN) AcpiTableInstance->Dsdt3;
+ Buffer64 = (UINT64) (UINTN) AcpiTableInstance->Dsdt3;
+ CopyMem (
+ &AcpiTableInstance->Fadt3->XDsdt,
+ &Buffer64,
+ sizeof (UINT64)
+ );
- //
- // RSDP OEM information is updated to match the FADT OEM information
- //
- CopyMem (
- &AcpiTableInstance->Rsdp3->OemId,
- &AcpiTableInstance->Fadt3->Header.OemId,
- 6
- );
-
- //
- // RSDT OEM information is updated to match FADT OEM information.
- //
- CopyMem (
- &AcpiTableInstance->Rsdt3->OemId,
- &AcpiTableInstance->Fadt3->Header.OemId,
- 6
- );
- CopyMem (
- &AcpiTableInstance->Rsdt3->OemTableId,
- &AcpiTableInstance->Fadt3->Header.OemTableId,
- sizeof (UINT64)
- );
- AcpiTableInstance->Rsdt3->OemRevision = AcpiTableInstance->Fadt3->Header.OemRevision;
-
- //
- // XSDT OEM information is updated to match FADT OEM information.
- //
- CopyMem (
- &AcpiTableInstance->Xsdt->OemId,
- &AcpiTableInstance->Fadt3->Header.OemId,
- 6
- );
- CopyMem (
- &AcpiTableInstance->Xsdt->OemTableId,
- &AcpiTableInstance->Fadt3->Header.OemTableId,
- sizeof (UINT64)
- );
- AcpiTableInstance->Xsdt->OemRevision = AcpiTableInstance->Fadt3->Header.OemRevision;
- }
+ //
+ // RSDP OEM information is updated to match the FADT OEM information
+ //
+ CopyMem (
+ &AcpiTableInstance->Rsdp3->OemId,
+ &AcpiTableInstance->Fadt3->Header.OemId,
+ 6
+ );
+
+ //
+ // RSDT OEM information is updated to match FADT OEM information.
+ //
+ CopyMem (
+ &AcpiTableInstance->Rsdt3->OemId,
+ &AcpiTableInstance->Fadt3->Header.OemId,
+ 6
+ );
+ CopyMem (
+ &AcpiTableInstance->Rsdt3->OemTableId,
+ &AcpiTableInstance->Fadt3->Header.OemTableId,
+ sizeof (UINT64)
+ );
+ AcpiTableInstance->Rsdt3->OemRevision = AcpiTableInstance->Fadt3->Header.OemRevision;
+
+ //
+ // XSDT OEM information is updated to match FADT OEM information.
+ //
+ CopyMem (
+ &AcpiTableInstance->Xsdt->OemId,
+ &AcpiTableInstance->Fadt3->Header.OemId,
+ 6
+ );
+ CopyMem (
+ &AcpiTableInstance->Xsdt->OemTableId,
+ &AcpiTableInstance->Fadt3->Header.OemTableId,
+ sizeof (UINT64)
+ );
+ AcpiTableInstance->Xsdt->OemRevision = AcpiTableInstance->Fadt3->Header.OemRevision;
}
//
// Checksum the table
diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/Vtutf8.c b/MdeModulePkg/Universal/Console/TerminalDxe/Vtutf8.c index 51cc093..26fc131 100644 --- a/MdeModulePkg/Universal/Console/TerminalDxe/Vtutf8.c +++ b/MdeModulePkg/Universal/Console/TerminalDxe/Vtutf8.c @@ -1,7 +1,7 @@ /** @file
Implementation of translation upon VT-UTF8.
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -145,10 +145,11 @@ GetOneValidUtf8Char ( // three-byte utf8 char go on
//
if ((Temp & 0xc0) == 0x80) {
-
- Utf8Char->Utf8_3[2 - Index] = Temp;
- Index++;
- if (Index > 2) {
+ if (Index == 1) {
+ Utf8Char->Utf8_3[1] = Temp;
+ Index++;
+ } else {
+ Utf8Char->Utf8_3[0] = Temp;
FetchFlag = FALSE;
}
} else {
diff --git a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c index ff9e4b2..e490ca4 100644 --- a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c +++ b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c @@ -1433,6 +1433,9 @@ DriverSampleUnload ( )
{
UINTN Index;
+
+ ASSERT (PrivateData != NULL);
+
if (DriverHandle[0] != NULL) {
gBS->UninstallMultipleProtocolInterfaces (
DriverHandle[0],
@@ -1463,15 +1466,13 @@ DriverSampleUnload ( HiiRemovePackages (PrivateData->HiiHandle[1]);
}
- if (PrivateData != NULL) {
- for (Index = 0; Index < NAME_VALUE_NAME_NUMBER; Index++) {
- if (PrivateData->NameValueName[Index] != NULL) {
- FreePool (PrivateData->NameValueName[Index]);
- }
+ for (Index = 0; Index < NAME_VALUE_NAME_NUMBER; Index++) {
+ if (PrivateData->NameValueName[Index] != NULL) {
+ FreePool (PrivateData->NameValueName[Index]);
}
- FreePool (PrivateData);
- PrivateData = NULL;
}
+ FreePool (PrivateData);
+ PrivateData = NULL;
return EFI_SUCCESS;
}
diff --git a/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideDxe.c b/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideDxe.c index 38812f9..1e5481e 100644 --- a/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideDxe.c +++ b/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideDxe.c @@ -1654,26 +1654,7 @@ PlatDriOverrideDxeInit ( return EFI_SUCCESS;
Finish:
- if (mCallbackInfo->DriverHandle != NULL) {
- gBS->UninstallMultipleProtocolInterfaces (
- mCallbackInfo->DriverHandle,
- &gEfiDevicePathProtocolGuid,
- &mHiiVendorDevicePath,
- &gEfiHiiConfigAccessProtocolGuid,
- &mCallbackInfo->ConfigAccess,
- &gEfiPlatformDriverOverrideProtocolGuid,
- &mCallbackInfo->PlatformDriverOverride,
- NULL
- );
- }
-
- if (mCallbackInfo->RegisteredHandle != NULL) {
- HiiRemovePackages (mCallbackInfo->RegisteredHandle);
- }
-
- if (mCallbackInfo != NULL) {
- FreePool (mCallbackInfo);
- }
+ PlatDriOverrideDxeUnload (ImageHandle);
return Status;
}
@@ -1691,6 +1672,8 @@ PlatDriOverrideDxeUnload ( IN EFI_HANDLE ImageHandle
)
{
+ ASSERT (mCallbackInfo != NULL);
+
if (mCallbackInfo->DriverHandle != NULL) {
gBS->UninstallMultipleProtocolInterfaces (
mCallbackInfo->DriverHandle,
@@ -1708,9 +1691,7 @@ PlatDriOverrideDxeUnload ( HiiRemovePackages (mCallbackInfo->RegisteredHandle);
}
- if (mCallbackInfo != NULL) {
- FreePool (mCallbackInfo);
- }
+ FreePool (mCallbackInfo);
return EFI_SUCCESS;
}
|