MdeModulePkg RamDiskDxe: Remove unnecessary TPL raise operations

There is no asynchronous operations to the registered RAM disks link list
maintained within RamDiskDxe driver, therefore, the TPL raise and restore
operations when dealing with the link list are unnecessary.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
This commit is contained in:
Hao Wu 2016-03-08 09:40:57 +08:00
parent 28620e603d
commit 6a9bc80154
2 changed files with 0 additions and 14 deletions

View File

@ -521,7 +521,6 @@ UpdateMainForm (
CHAR16 *String; CHAR16 *String;
CHAR16 RamDiskStr[128]; CHAR16 RamDiskStr[128];
EFI_STRING_ID StringId; EFI_STRING_ID StringId;
EFI_TPL OldTpl;
// //
// Init OpCode Handle // Init OpCode Handle
@ -557,7 +556,6 @@ UpdateMainForm (
EndLabel->Number = MAIN_LABEL_LIST_END; EndLabel->Number = MAIN_LABEL_LIST_END;
Index = 0; Index = 0;
OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
EFI_LIST_FOR_EACH (Entry, &RegisteredRamDisks) { EFI_LIST_FOR_EACH (Entry, &RegisteredRamDisks) {
PrivateData = RAM_DISK_PRIVATE_FROM_THIS (Entry); PrivateData = RAM_DISK_PRIVATE_FROM_THIS (Entry);
String = RamDiskStr; String = RamDiskStr;
@ -588,7 +586,6 @@ UpdateMainForm (
Index++; Index++;
} }
gBS->RestoreTPL (OldTpl);
HiiUpdateForm ( HiiUpdateForm (
ConfigPrivate->HiiHandle, ConfigPrivate->HiiHandle,
@ -645,7 +642,6 @@ RamDiskCallback (
EFI_FILE_HANDLE FileHandle; EFI_FILE_HANDLE FileHandle;
LIST_ENTRY *Entry; LIST_ENTRY *Entry;
LIST_ENTRY *NextEntry; LIST_ENTRY *NextEntry;
EFI_TPL OldTpl;
if ((This == NULL) || (Value == NULL) || (ActionRequest == NULL)) { if ((This == NULL) || (Value == NULL) || (ActionRequest == NULL)) {
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
@ -747,7 +743,6 @@ RamDiskCallback (
// Remove the selected RAM disks // Remove the selected RAM disks
// //
Index = 0; Index = 0;
OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
EFI_LIST_FOR_EACH_SAFE (Entry, NextEntry, &RegisteredRamDisks) { EFI_LIST_FOR_EACH_SAFE (Entry, NextEntry, &RegisteredRamDisks) {
if (Configuration->RamDiskList[Index++] != 0) { if (Configuration->RamDiskList[Index++] != 0) {
PrivateData = RAM_DISK_PRIVATE_FROM_THIS (Entry); PrivateData = RAM_DISK_PRIVATE_FROM_THIS (Entry);
@ -757,7 +752,6 @@ RamDiskCallback (
); );
} }
} }
gBS->RestoreTPL (OldTpl);
UpdateMainForm (ConfigPrivate); UpdateMainForm (ConfigPrivate);

View File

@ -103,7 +103,6 @@ RamDiskRegister (
MEDIA_RAM_DISK_DEVICE_PATH *RamDiskDevNode; MEDIA_RAM_DISK_DEVICE_PATH *RamDiskDevNode;
UINTN DevicePathSize; UINTN DevicePathSize;
LIST_ENTRY *Entry; LIST_ENTRY *Entry;
EFI_TPL OldTpl;
if ((0 == RamDiskSize) || (NULL == RamDiskType) || (NULL == DevicePath)) { if ((0 == RamDiskSize) || (NULL == RamDiskType) || (NULL == DevicePath)) {
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
@ -163,7 +162,6 @@ RamDiskRegister (
// Check whether the created device path is already present in the handle // Check whether the created device path is already present in the handle
// database // database
// //
OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
if (!IsListEmpty(&RegisteredRamDisks)) { if (!IsListEmpty(&RegisteredRamDisks)) {
DevicePathSize = GetDevicePathSize (PrivateData->DevicePath); DevicePathSize = GetDevicePathSize (PrivateData->DevicePath);
@ -184,7 +182,6 @@ RamDiskRegister (
} }
} }
} }
gBS->RestoreTPL (OldTpl);
// //
// Fill Block IO protocol informations for the RAM disk // Fill Block IO protocol informations for the RAM disk
@ -212,10 +209,8 @@ RamDiskRegister (
// //
// Insert the newly created one to the registered RAM disk list // Insert the newly created one to the registered RAM disk list
// //
OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
InsertTailList (&RegisteredRamDisks, &PrivateData->ThisInstance); InsertTailList (&RegisteredRamDisks, &PrivateData->ThisInstance);
ListEntryNum++; ListEntryNum++;
gBS->RestoreTPL (OldTpl);
gBS->ConnectController (PrivateData->Handle, NULL, NULL, TRUE); gBS->ConnectController (PrivateData->Handle, NULL, NULL, TRUE);
@ -269,7 +264,6 @@ RamDiskUnregister (
EFI_DEVICE_PATH_PROTOCOL *Header; EFI_DEVICE_PATH_PROTOCOL *Header;
MEDIA_RAM_DISK_DEVICE_PATH *RamDiskDevNode; MEDIA_RAM_DISK_DEVICE_PATH *RamDiskDevNode;
RAM_DISK_PRIVATE_DATA *PrivateData; RAM_DISK_PRIVATE_DATA *PrivateData;
EFI_TPL OldTpl;
if (NULL == DevicePath) { if (NULL == DevicePath) {
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
@ -302,7 +296,6 @@ RamDiskUnregister (
StartingAddr = ReadUnaligned64 ((UINT64 *) &(RamDiskDevNode->StartingAddr[0])); StartingAddr = ReadUnaligned64 ((UINT64 *) &(RamDiskDevNode->StartingAddr[0]));
EndingAddr = ReadUnaligned64 ((UINT64 *) &(RamDiskDevNode->EndingAddr[0])); EndingAddr = ReadUnaligned64 ((UINT64 *) &(RamDiskDevNode->EndingAddr[0]));
OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
if (!IsListEmpty(&RegisteredRamDisks)) { if (!IsListEmpty(&RegisteredRamDisks)) {
EFI_LIST_FOR_EACH_SAFE (Entry, NextEntry, &RegisteredRamDisks) { EFI_LIST_FOR_EACH_SAFE (Entry, NextEntry, &RegisteredRamDisks) {
PrivateData = RAM_DISK_PRIVATE_FROM_THIS (Entry); PrivateData = RAM_DISK_PRIVATE_FROM_THIS (Entry);
@ -348,7 +341,6 @@ RamDiskUnregister (
} }
} }
} }
gBS->RestoreTPL (OldTpl);
if (TRUE == Found) { if (TRUE == Found) {
return EFI_SUCCESS; return EFI_SUCCESS;