]> git.proxmox.com Git - mirror_edk2.git/blobdiff - StandaloneMmPkg/Core/Handle.c
StandaloneMmPkg: Apply uncrustify changes
[mirror_edk2.git] / StandaloneMmPkg / Core / Handle.c
index 3a9cec7a707d1372c354679062845b79f7f6b8ed..7df4629cf291847f46ed597f9e39dcebe43ec1f4 100644 (file)
@@ -13,8 +13,8 @@
 // mProtocolDatabase     - A list of all protocols in the system.  (simple list for now)\r
 // gHandleList           - A list of all the handles in the system\r
 //\r
-LIST_ENTRY  mProtocolDatabase  = INITIALIZE_LIST_HEAD_VARIABLE (mProtocolDatabase);\r
-LIST_ENTRY  gHandleList        = INITIALIZE_LIST_HEAD_VARIABLE (gHandleList);\r
+LIST_ENTRY  mProtocolDatabase = INITIALIZE_LIST_HEAD_VARIABLE (mProtocolDatabase);\r
+LIST_ENTRY  gHandleList       = INITIALIZE_LIST_HEAD_VARIABLE (gHandleList);\r
 \r
 /**\r
   Check whether a handle is a valid EFI_HANDLE\r
@@ -36,9 +36,11 @@ MmValidateHandle (
   if (Handle == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
+\r
   if (Handle->Signature != EFI_HANDLE_SIGNATURE) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
+\r
   return EFI_SUCCESS;\r
 }\r
 \r
@@ -53,13 +55,13 @@ MmValidateHandle (
 **/\r
 PROTOCOL_ENTRY  *\r
 MmFindProtocolEntry (\r
-  IN EFI_GUID   *Protocol,\r
-  IN BOOLEAN    Create\r
+  IN EFI_GUID  *Protocol,\r
+  IN BOOLEAN   Create\r
   )\r
 {\r
-  LIST_ENTRY          *Link;\r
-  PROTOCOL_ENTRY      *Item;\r
-  PROTOCOL_ENTRY      *ProtEntry;\r
+  LIST_ENTRY      *Link;\r
+  PROTOCOL_ENTRY  *Item;\r
+  PROTOCOL_ENTRY  *ProtEntry;\r
 \r
   //\r
   // Search the database for the matching GUID\r
@@ -68,8 +70,8 @@ MmFindProtocolEntry (
   ProtEntry = NULL;\r
   for (Link = mProtocolDatabase.ForwardLink;\r
        Link != &mProtocolDatabase;\r
-       Link = Link->ForwardLink) {\r
-\r
+       Link = Link->ForwardLink)\r
+  {\r
     Item = CR (Link, PROTOCOL_ENTRY, AllEntries, PROTOCOL_ENTRY_SIGNATURE);\r
     if (CompareGuid (&Item->ProtocolID, Protocol)) {\r
       //\r
@@ -85,7 +87,7 @@ MmFindProtocolEntry (
   // allocate a new entry\r
   //\r
   if ((ProtEntry == NULL) && Create) {\r
-    ProtEntry = AllocatePool (sizeof(PROTOCOL_ENTRY));\r
+    ProtEntry = AllocatePool (sizeof (PROTOCOL_ENTRY));\r
     if (ProtEntry != NULL) {\r
       //\r
       // Initialize new protocol entry structure\r
@@ -101,6 +103,7 @@ MmFindProtocolEntry (
       InsertTailList (&mProtocolDatabase, &ProtEntry->AllEntries);\r
     }\r
   }\r
+\r
   return ProtEntry;\r
 }\r
 \r
@@ -137,17 +140,19 @@ MmFindProtocolInterface (
     //\r
     // Look at each protocol interface for any matches\r
     //\r
-    for (Link = Handle->Protocols.ForwardLink; Link != &Handle->Protocols; Link=Link->ForwardLink) {\r
+    for (Link = Handle->Protocols.ForwardLink; Link != &Handle->Protocols; Link = Link->ForwardLink) {\r
       //\r
       // If this protocol interface matches, remove it\r
       //\r
       Prot = CR (Link, PROTOCOL_INTERFACE, Link, PROTOCOL_INTERFACE_SIGNATURE);\r
-      if (Prot->Interface == Interface && Prot->Protocol == ProtEntry) {\r
+      if ((Prot->Interface == Interface) && (Prot->Protocol == ProtEntry)) {\r
         break;\r
       }\r
+\r
       Prot = NULL;\r
     }\r
   }\r
+\r
   return Prot;\r
 }\r
 \r
@@ -219,7 +224,7 @@ MmInstallProtocolInterfaceNotify (
   // returns EFI_INVALID_PARAMETER if InterfaceType is invalid.\r
   // Also added check for invalid UserHandle and Protocol pointers.\r
   //\r
-  if (UserHandle == NULL || Protocol == NULL) {\r
+  if ((UserHandle == NULL) || (Protocol == NULL)) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
@@ -233,7 +238,7 @@ MmInstallProtocolInterfaceNotify (
   DEBUG ((DEBUG_LOAD | DEBUG_INFO, "MmInstallProtocolInterface: %g %p\n", Protocol, Interface));\r
 \r
   Status = EFI_OUT_OF_RESOURCES;\r
-  Prot = NULL;\r
+  Prot   = NULL;\r
   Handle = NULL;\r
 \r
   if (*UserHandle != NULL) {\r
@@ -298,8 +303,8 @@ MmInstallProtocolInterfaceNotify (
   // Initialize the protocol interface structure\r
   //\r
   Prot->Signature = PROTOCOL_INTERFACE_SIGNATURE;\r
-  Prot->Handle = Handle;\r
-  Prot->Protocol = ProtEntry;\r
+  Prot->Handle    = Handle;\r
+  Prot->Protocol  = ProtEntry;\r
   Prot->Interface = Interface;\r
 \r
   //\r
@@ -320,6 +325,7 @@ MmInstallProtocolInterfaceNotify (
   if (Notify) {\r
     MmNotifyProtocol (Prot);\r
   }\r
+\r
   Status = EFI_SUCCESS;\r
 \r
 Done:\r
@@ -336,6 +342,7 @@ Done:
       FreePool (Prot);\r
     }\r
   }\r
+\r
   return Status;\r
 }\r
 \r
@@ -416,6 +423,7 @@ MmUninstallProtocolInterface (
     RemoveEntryList (&Handle->AllHandles);\r
     FreePool (Handle);\r
   }\r
+\r
   return Status;\r
 }\r
 \r
@@ -451,12 +459,13 @@ MmGetProtocolInterface (
   // Look at each protocol interface for a match\r
   //\r
   for (Link = Handle->Protocols.ForwardLink; Link != &Handle->Protocols; Link = Link->ForwardLink) {\r
-    Prot = CR (Link, PROTOCOL_INTERFACE, Link, PROTOCOL_INTERFACE_SIGNATURE);\r
+    Prot      = CR (Link, PROTOCOL_INTERFACE, Link, PROTOCOL_INTERFACE_SIGNATURE);\r
     ProtEntry = Prot->Protocol;\r
     if (CompareGuid (&ProtEntry->ProtocolID, Protocol)) {\r
       return Prot;\r
     }\r
   }\r
+\r
   return NULL;\r
 }\r
 \r