Revision: 17566
http://sourceforge.net/p/edk2/code/17566
Author: jyao1
Date: 2015-06-06 23:49:39 +0000 (Sat, 06 Jun 2015)
Log Message:
-----------
PiSmmCore dispatcher should not use one Index for three loops.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Zachary Bobroff" <[email protected]>
Reviewed-by: "Yao, Jiewen" <[email protected]>
Modified Paths:
--------------
trunk/edk2/MdeModulePkg/Core/PiSmmCore/Dispatcher.c
Modified: trunk/edk2/MdeModulePkg/Core/PiSmmCore/Dispatcher.c
===================================================================
--- trunk/edk2/MdeModulePkg/Core/PiSmmCore/Dispatcher.c 2015-06-05 13:19:45 UTC
(rev 17565)
+++ trunk/edk2/MdeModulePkg/Core/PiSmmCore/Dispatcher.c 2015-06-06 23:49:39 UTC
(rev 17566)
@@ -1215,7 +1215,9 @@
EFI_SMM_DRIVER_ENTRY *DriverEntry;
EFI_GUID *AprioriFile;
UINTN AprioriEntryCount;
- UINTN Index;
+ UINTN HandleIndex;
+ UINTN SmmTypeIndex;
+ UINTN AprioriIndex;
LIST_ENTRY *Link;
UINT32 AuthenticationStatus;
UINTN SizeOfBuffer;
@@ -1232,8 +1234,8 @@
return EFI_NOT_FOUND;
}
- for (Index = 0; Index < HandleCount; Index++) {
- FvHandle = HandleBuffer[Index];
+ for (HandleIndex = 0; HandleIndex < HandleCount; HandleIndex++) {
+ FvHandle = HandleBuffer[HandleIndex];
if (FvHasBeenProcessed (FvHandle)) {
//
@@ -1268,13 +1270,13 @@
// Discover Drivers in FV and add them to the Discovered Driver List.
// Process EFI_FV_FILETYPE_SMM type and then
EFI_FV_FILETYPE_COMBINED_SMM_DXE
//
- for (Index = 0; Index < sizeof (mSmmFileTypes)/sizeof (EFI_FV_FILETYPE);
Index++) {
+ for (SmmTypeIndex = 0; SmmTypeIndex < sizeof (mSmmFileTypes)/sizeof
(EFI_FV_FILETYPE); SmmTypeIndex++) {
//
// Initialize the search key
//
Key = 0;
do {
- Type = mSmmFileTypes[Index];
+ Type = mSmmFileTypes[SmmTypeIndex];
GetNextFileStatus = Fv->GetNextFile (
Fv,
&Key,
@@ -1315,10 +1317,10 @@
// is only valid for the FV that it resided in.
//
- for (Index = 0; Index < AprioriEntryCount; Index++) {
+ for (AprioriIndex = 0; AprioriIndex < AprioriEntryCount; AprioriIndex++) {
for (Link = mDiscoveredList.ForwardLink; Link != &mDiscoveredList; Link
= Link->ForwardLink) {
DriverEntry = CR(Link, EFI_SMM_DRIVER_ENTRY, Link,
EFI_SMM_DRIVER_ENTRY_SIGNATURE);
- if (CompareGuid (&DriverEntry->FileName, &AprioriFile[Index]) &&
+ if (CompareGuid (&DriverEntry->FileName, &AprioriFile[AprioriIndex]) &&
(FvHandle == DriverEntry->FvHandle)) {
DriverEntry->Dependent = FALSE;
DriverEntry->Scheduled = TRUE;
------------------------------------------------------------------------------
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits