summaryrefslogtreecommitdiff
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2008-09-17 13:31:43 +0000
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2008-09-17 13:31:43 +0000
commit3f1435782f57f001a7f4ae7d928d817ee3fe27f0 (patch)
tree41509370ee10726013f426fd0eb2b21ca8583910 /MdeModulePkg
parent57b4ecb94bceac2484dd9367b2ad111b05e17d97 (diff)
downloadedk2-3f1435782f57f001a7f4ae7d928d817ee3fe27f0.zip
edk2-3f1435782f57f001a7f4ae7d928d817ee3fe27f0.tar.gz
edk2-3f1435782f57f001a7f4ae7d928d817ee3fe27f0.tar.bz2
Refine code to remove the last entry of mArchProtocol.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5917 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Core/Dxe/DxeMain/DxeProtocolNotify.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/MdeModulePkg/Core/Dxe/DxeMain/DxeProtocolNotify.c b/MdeModulePkg/Core/Dxe/DxeMain/DxeProtocolNotify.c
index 2043384..6eacd23 100644
--- a/MdeModulePkg/Core/Dxe/DxeMain/DxeProtocolNotify.c
+++ b/MdeModulePkg/Core/Dxe/DxeMain/DxeProtocolNotify.c
@@ -39,8 +39,7 @@ ARCHITECTURAL_PROTOCOL_ENTRY mArchProtocols[] = {
{ &gEfiCapsuleArchProtocolGuid, (VOID **)NULL, NULL, NULL, FALSE },
{ &gEfiMonotonicCounterArchProtocolGuid, (VOID **)NULL, NULL, NULL, FALSE },
{ &gEfiResetArchProtocolGuid, (VOID **)NULL, NULL, NULL, FALSE },
- { &gEfiRealTimeClockArchProtocolGuid, (VOID **)NULL, NULL, NULL, FALSE },
- { NULL, (VOID **)NULL, NULL, NULL, FALSE }
+ { &gEfiRealTimeClockArchProtocolGuid, (VOID **)NULL, NULL, NULL, FALSE }
};
@@ -57,10 +56,10 @@ CoreAllEfiServicesAvailable (
VOID
)
{
- ARCHITECTURAL_PROTOCOL_ENTRY *Entry;
+ UINTN Index;
- for (Entry = mArchProtocols; Entry->ProtocolGuid != NULL; Entry++) {
- if (!Entry->Present) {
+ for (Index = 0; Index < sizeof (mArchProtocols) / sizeof (mArchProtocols[0]); Index++) {
+ if (!mArchProtocols[Index].Present) {
return EFI_NOT_FOUND;
}
}
@@ -93,9 +92,11 @@ GenericArchProtocolNotify (
BOOLEAN Found;
LIST_ENTRY *Link;
LIST_ENTRY TempLinkNode;
+ UINTN Index;
Found = FALSE;
- for (Entry = mArchProtocols; Entry->ProtocolGuid != NULL; Entry++) {
+ for (Index = 0; Index < sizeof (mArchProtocols) / sizeof (mArchProtocols[0]); Index++) {
+ Entry = &mArchProtocols[Index];
Status = CoreLocateProtocol (Entry->ProtocolGuid, Entry->Registration, &Protocol);
if (EFI_ERROR (Status)) {
@@ -180,8 +181,10 @@ CoreNotifyOnArchProtocolInstallation (
{
EFI_STATUS Status;
ARCHITECTURAL_PROTOCOL_ENTRY *Entry;
+ UINTN Index;
- for (Entry = mArchProtocols; Entry->ProtocolGuid != NULL; Entry++) {
+ for (Index = 0; Index < sizeof (mArchProtocols) / sizeof (mArchProtocols[0]); Index++) {
+ Entry = &mArchProtocols[Index];
//
// Create the event
@@ -245,8 +248,10 @@ CoreDisplayMissingArchProtocols (
{
CONST GUID_TO_STRING_PROTOCOL_ENTRY *MissingEntry;
ARCHITECTURAL_PROTOCOL_ENTRY *Entry;
+ UINTN Index;
- for (Entry = mArchProtocols; Entry->ProtocolGuid != NULL; Entry++) {
+ for (Index = 0; Index < sizeof (mArchProtocols) / sizeof (mArchProtocols[0]); Index++) {
+ Entry = &mArchProtocols[Index];
if (!Entry->Present) {
for (MissingEntry = MissingProtocols; TRUE ; MissingEntry++) {
if (CompareGuid (Entry->ProtocolGuid, MissingEntry->ProtocolGuid)) {