Small code refinement in MdeModulePkg.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10492 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
rsun3 2010-05-17 08:32:05 +00:00
parent 0e4483bc69
commit f0c855b263
4 changed files with 70 additions and 89 deletions

View File

@ -719,7 +719,6 @@ AddTableToList (
// //
// Update pointers in FADT. If tables don't exist this will put NULL pointers there. // 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; AcpiTableInstance->Fadt3->FirmwareCtrl = (UINT32) (UINTN) AcpiTableInstance->Facs3;
Buffer64 = (UINT64) (UINTN) AcpiTableInstance->Facs3; Buffer64 = (UINT64) (UINTN) AcpiTableInstance->Facs3;
CopyMem ( CopyMem (
@ -774,7 +773,6 @@ AddTableToList (
); );
AcpiTableInstance->Xsdt->OemRevision = AcpiTableInstance->Fadt3->Header.OemRevision; AcpiTableInstance->Xsdt->OemRevision = AcpiTableInstance->Fadt3->Header.OemRevision;
} }
}
// //
// Checksum the table // Checksum the table
// //

View File

@ -1,7 +1,7 @@
/** @file /** @file
Implementation of translation upon VT-UTF8. 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 This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 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 // three-byte utf8 char go on
// //
if ((Temp & 0xc0) == 0x80) { if ((Temp & 0xc0) == 0x80) {
if (Index == 1) {
Utf8Char->Utf8_3[2 - Index] = Temp; Utf8Char->Utf8_3[1] = Temp;
Index++; Index++;
if (Index > 2) { } else {
Utf8Char->Utf8_3[0] = Temp;
FetchFlag = FALSE; FetchFlag = FALSE;
} }
} else { } else {

View File

@ -1433,6 +1433,9 @@ DriverSampleUnload (
) )
{ {
UINTN Index; UINTN Index;
ASSERT (PrivateData != NULL);
if (DriverHandle[0] != NULL) { if (DriverHandle[0] != NULL) {
gBS->UninstallMultipleProtocolInterfaces ( gBS->UninstallMultipleProtocolInterfaces (
DriverHandle[0], DriverHandle[0],
@ -1463,7 +1466,6 @@ DriverSampleUnload (
HiiRemovePackages (PrivateData->HiiHandle[1]); HiiRemovePackages (PrivateData->HiiHandle[1]);
} }
if (PrivateData != NULL) {
for (Index = 0; Index < NAME_VALUE_NAME_NUMBER; Index++) { for (Index = 0; Index < NAME_VALUE_NAME_NUMBER; Index++) {
if (PrivateData->NameValueName[Index] != NULL) { if (PrivateData->NameValueName[Index] != NULL) {
FreePool (PrivateData->NameValueName[Index]); FreePool (PrivateData->NameValueName[Index]);
@ -1471,7 +1473,6 @@ DriverSampleUnload (
} }
FreePool (PrivateData); FreePool (PrivateData);
PrivateData = NULL; PrivateData = NULL;
}
return EFI_SUCCESS; return EFI_SUCCESS;
} }

View File

@ -1654,26 +1654,7 @@ PlatDriOverrideDxeInit (
return EFI_SUCCESS; return EFI_SUCCESS;
Finish: Finish:
if (mCallbackInfo->DriverHandle != NULL) { PlatDriOverrideDxeUnload (ImageHandle);
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);
}
return Status; return Status;
} }
@ -1691,6 +1672,8 @@ PlatDriOverrideDxeUnload (
IN EFI_HANDLE ImageHandle IN EFI_HANDLE ImageHandle
) )
{ {
ASSERT (mCallbackInfo != NULL);
if (mCallbackInfo->DriverHandle != NULL) { if (mCallbackInfo->DriverHandle != NULL) {
gBS->UninstallMultipleProtocolInterfaces ( gBS->UninstallMultipleProtocolInterfaces (
mCallbackInfo->DriverHandle, mCallbackInfo->DriverHandle,
@ -1708,9 +1691,7 @@ PlatDriOverrideDxeUnload (
HiiRemovePackages (mCallbackInfo->RegisteredHandle); HiiRemovePackages (mCallbackInfo->RegisteredHandle);
} }
if (mCallbackInfo != NULL) {
FreePool (mCallbackInfo); FreePool (mCallbackInfo);
}
return EFI_SUCCESS; return EFI_SUCCESS;
} }