MdeModulePkg/UsbMass: remove unnecessary RestoreTPL() call

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
This commit is contained in:
Ruiyu Ni 2018-03-02 17:33:15 +08:00
parent e149055310
commit cd626ef0fb

View File

@ -691,7 +691,6 @@ UsbBootDetectMedia (
EFI_BLOCK_IO_MEDIA OldMedia; EFI_BLOCK_IO_MEDIA OldMedia;
EFI_BLOCK_IO_MEDIA *Media; EFI_BLOCK_IO_MEDIA *Media;
UINT8 CmdSet; UINT8 CmdSet;
EFI_TPL OldTpl;
EFI_STATUS Status; EFI_STATUS Status;
Media = &UsbMass->BlockIoMedia; Media = &UsbMass->BlockIoMedia;
@ -740,11 +739,10 @@ ON_ERROR:
(Media->LastBlock != OldMedia.LastBlock)) { (Media->LastBlock != OldMedia.LastBlock)) {
// //
// This function is called by Block I/O Protocol APIs, which run at TPL_NOTIFY. // This function is called from:
// Here we temporarily restore TPL to TPL_CALLBACK to invoke ReinstallProtocolInterface(). // Block I/O Protocol APIs, which run at TPL_CALLBACK.
// // DriverBindingStart(), which raises to TPL_CALLBACK.
OldTpl = EfiGetCurrentTpl (); ASSERT (EfiGetCurrentTpl () == TPL_CALLBACK);
gBS->RestoreTPL (TPL_CALLBACK);
gBS->ReinstallProtocolInterface ( gBS->ReinstallProtocolInterface (
UsbMass->Controller, UsbMass->Controller,
@ -753,9 +751,6 @@ ON_ERROR:
&UsbMass->BlockIo &UsbMass->BlockIo
); );
ASSERT (EfiGetCurrentTpl () == TPL_CALLBACK);
gBS->RaiseTPL (OldTpl);
// //
// Update MediaId after reinstalling Block I/O Protocol. // Update MediaId after reinstalling Block I/O Protocol.
// //