]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/DxeHstiLib/HstiDxe.c
MdePkg: Apply uncrustify changes
[mirror_edk2.git] / MdePkg / Library / DxeHstiLib / HstiDxe.c
index 3f4d8eb79c728e21c3e8fd9fe644509b9c786365..d895599cd460d5b5b2c1ba7bd09177daadc94a19 100644 (file)
 **/\r
 VOID *\r
 InternalHstiFindAip (\r
 **/\r
 VOID *\r
 InternalHstiFindAip (\r
-  IN UINT32                   Role,\r
-  IN CHAR16                   *ImplementationID OPTIONAL,\r
-  OUT VOID                    **HstiData OPTIONAL,\r
-  OUT UINTN                   *HstiSize OPTIONAL\r
+  IN UINT32  Role,\r
+  IN CHAR16  *ImplementationID OPTIONAL,\r
+  OUT VOID   **HstiData OPTIONAL,\r
+  OUT UINTN  *HstiSize OPTIONAL\r
   )\r
 {\r
   EFI_STATUS                        Status;\r
   )\r
 {\r
   EFI_STATUS                        Status;\r
@@ -55,9 +55,9 @@ InternalHstiFindAip (
     return NULL;\r
   }\r
 \r
     return NULL;\r
   }\r
 \r
-  Hsti = NULL;\r
-  Aip = NULL;\r
-  InformationBlock = NULL;\r
+  Hsti                 = NULL;\r
+  Aip                  = NULL;\r
+  InformationBlock     = NULL;\r
   InformationBlockSize = 0;\r
   for (Index = 0; Index < NoHandles; Index++) {\r
     Status = gBS->HandleProtocol (\r
   InformationBlockSize = 0;\r
   for (Index = 0; Index < NoHandles; Index++) {\r
     Status = gBS->HandleProtocol (\r
@@ -88,6 +88,7 @@ InternalHstiFindAip (
         break;\r
       }\r
     }\r
         break;\r
       }\r
     }\r
+\r
     FreePool (InfoTypesBuffer);\r
 \r
     if (AipCandidate == NULL) {\r
     FreePool (InfoTypesBuffer);\r
 \r
     if (AipCandidate == NULL) {\r
@@ -97,7 +98,7 @@ InternalHstiFindAip (
     //\r
     // Check HSTI Role\r
     //\r
     //\r
     // Check HSTI Role\r
     //\r
-    Aip = AipCandidate;\r
+    Aip    = AipCandidate;\r
     Status = Aip->GetInformation (\r
                     Aip,\r
                     &gAdapterInfoPlatformSecurityGuid,\r
     Status = Aip->GetInformation (\r
                     Aip,\r
                     &gAdapterInfoPlatformSecurityGuid,\r
@@ -110,7 +111,8 @@ InternalHstiFindAip (
 \r
     Hsti = InformationBlock;\r
     if ((Hsti->Role == Role) &&\r
 \r
     Hsti = InformationBlock;\r
     if ((Hsti->Role == Role) &&\r
-        ((ImplementationID == NULL) || (StrCmp (ImplementationID, Hsti->ImplementationID) == 0))) {\r
+        ((ImplementationID == NULL) || (StrCmp (ImplementationID, Hsti->ImplementationID) == 0)))\r
+    {\r
       break;\r
     } else {\r
       Hsti = NULL;\r
       break;\r
     } else {\r
       Hsti = NULL;\r
@@ -118,6 +120,7 @@ InternalHstiFindAip (
       continue;\r
     }\r
   }\r
       continue;\r
     }\r
   }\r
+\r
   FreePool (Handles);\r
 \r
   if (Hsti == NULL) {\r
   FreePool (Handles);\r
 \r
   if (Hsti == NULL) {\r
@@ -127,9 +130,11 @@ InternalHstiFindAip (
   if (HstiData != NULL) {\r
     *HstiData = InformationBlock;\r
   }\r
   if (HstiData != NULL) {\r
     *HstiData = InformationBlock;\r
   }\r
+\r
   if (HstiSize != NULL) {\r
     *HstiSize = InformationBlockSize;\r
   }\r
   if (HstiSize != NULL) {\r
     *HstiSize = InformationBlockSize;\r
   }\r
+\r
   return Aip;\r
 }\r
 \r
   return Aip;\r
 }\r
 \r
@@ -144,8 +149,8 @@ InternalHstiFindAip (
 **/\r
 BOOLEAN\r
 InternalHstiIsValidTable (\r
 **/\r
 BOOLEAN\r
 InternalHstiIsValidTable (\r
-  IN VOID                     *HstiData,\r
-  IN UINTN                    HstiSize\r
+  IN VOID   *HstiData,\r
+  IN UINTN  HstiSize\r
   )\r
 {\r
   ADAPTER_INFO_PLATFORM_SECURITY  *Hsti;\r
   )\r
 {\r
   ADAPTER_INFO_PLATFORM_SECURITY  *Hsti;\r
@@ -164,11 +169,13 @@ InternalHstiIsValidTable (
     DEBUG ((DEBUG_ERROR, "HstiData == NULL\n"));\r
     return FALSE;\r
   }\r
     DEBUG ((DEBUG_ERROR, "HstiData == NULL\n"));\r
     return FALSE;\r
   }\r
-  if (HstiSize < sizeof(ADAPTER_INFO_PLATFORM_SECURITY)) {\r
+\r
+  if (HstiSize < sizeof (ADAPTER_INFO_PLATFORM_SECURITY)) {\r
     DEBUG ((DEBUG_ERROR, "HstiSize < sizeof(ADAPTER_INFO_PLATFORM_SECURITY)\n"));\r
     return FALSE;\r
   }\r
     DEBUG ((DEBUG_ERROR, "HstiSize < sizeof(ADAPTER_INFO_PLATFORM_SECURITY)\n"));\r
     return FALSE;\r
   }\r
-  if (((HstiSize - sizeof(ADAPTER_INFO_PLATFORM_SECURITY)) / 3) < Hsti->SecurityFeaturesSize) {\r
+\r
+  if (((HstiSize - sizeof (ADAPTER_INFO_PLATFORM_SECURITY)) / 3) < Hsti->SecurityFeaturesSize) {\r
     DEBUG ((DEBUG_ERROR, "((HstiSize - sizeof(ADAPTER_INFO_PLATFORM_SECURITY)) / 3) < SecurityFeaturesSize\n"));\r
     return FALSE;\r
   }\r
     DEBUG ((DEBUG_ERROR, "((HstiSize - sizeof(ADAPTER_INFO_PLATFORM_SECURITY)) / 3) < SecurityFeaturesSize\n"));\r
     return FALSE;\r
   }\r
@@ -185,7 +192,8 @@ InternalHstiIsValidTable (
   // Check Role\r
   //\r
   if ((Hsti->Role < PLATFORM_SECURITY_ROLE_PLATFORM_REFERENCE) ||\r
   // Check Role\r
   //\r
   if ((Hsti->Role < PLATFORM_SECURITY_ROLE_PLATFORM_REFERENCE) ||\r
-      (Hsti->Role > PLATFORM_SECURITY_ROLE_IMPLEMENTOR_ODM)) {\r
+      (Hsti->Role > PLATFORM_SECURITY_ROLE_IMPLEMENTOR_ODM))\r
+  {\r
     DEBUG ((DEBUG_ERROR, "Role < PLATFORM_SECURITY_ROLE_PLATFORM_REFERENCE ||\n"));\r
     DEBUG ((DEBUG_ERROR, "Role > PLATFORM_SECURITY_ROLE_IMPLEMENTOR_ODM\n"));\r
     return FALSE;\r
     DEBUG ((DEBUG_ERROR, "Role < PLATFORM_SECURITY_ROLE_PLATFORM_REFERENCE ||\n"));\r
     DEBUG ((DEBUG_ERROR, "Role > PLATFORM_SECURITY_ROLE_IMPLEMENTOR_ODM\n"));\r
     return FALSE;\r
@@ -194,18 +202,19 @@ InternalHstiIsValidTable (
   //\r
   // Check ImplementationID\r
   //\r
   //\r
   // Check ImplementationID\r
   //\r
-  for (Index = 0; Index < sizeof(Hsti->ImplementationID)/sizeof(Hsti->ImplementationID[0]); Index++) {\r
+  for (Index = 0; Index < sizeof (Hsti->ImplementationID)/sizeof (Hsti->ImplementationID[0]); Index++) {\r
     if (Hsti->ImplementationID[Index] == 0) {\r
       break;\r
     }\r
   }\r
     if (Hsti->ImplementationID[Index] == 0) {\r
       break;\r
     }\r
   }\r
-  if (Index == sizeof(Hsti->ImplementationID)/sizeof(Hsti->ImplementationID[0])) {\r
+\r
+  if (Index == sizeof (Hsti->ImplementationID)/sizeof (Hsti->ImplementationID[0])) {\r
     DEBUG ((DEBUG_ERROR, "ImplementationID has no NUL CHAR\n"));\r
     return FALSE;\r
   }\r
 \r
     DEBUG ((DEBUG_ERROR, "ImplementationID has no NUL CHAR\n"));\r
     return FALSE;\r
   }\r
 \r
-  ErrorStringSize = HstiSize - sizeof(ADAPTER_INFO_PLATFORM_SECURITY) - Hsti->SecurityFeaturesSize * 3;\r
-  ErrorString = (CHAR16 *)((UINTN)Hsti + sizeof(ADAPTER_INFO_PLATFORM_SECURITY) + Hsti->SecurityFeaturesSize * 3);\r
+  ErrorStringSize = HstiSize - sizeof (ADAPTER_INFO_PLATFORM_SECURITY) - Hsti->SecurityFeaturesSize * 3;\r
+  ErrorString     = (CHAR16 *)((UINTN)Hsti + sizeof (ADAPTER_INFO_PLATFORM_SECURITY) + Hsti->SecurityFeaturesSize * 3);\r
 \r
   //\r
   // basic check for ErrorString\r
 \r
   //\r
   // basic check for ErrorString\r
@@ -214,6 +223,7 @@ InternalHstiIsValidTable (
     DEBUG ((DEBUG_ERROR, "ErrorStringSize == 0\n"));\r
     return FALSE;\r
   }\r
     DEBUG ((DEBUG_ERROR, "ErrorStringSize == 0\n"));\r
     return FALSE;\r
   }\r
+\r
   if ((ErrorStringSize & BIT0) != 0) {\r
     DEBUG ((DEBUG_ERROR, "(ErrorStringSize & BIT0) != 0\n"));\r
     return FALSE;\r
   if ((ErrorStringSize & BIT0) != 0) {\r
     DEBUG ((DEBUG_ERROR, "(ErrorStringSize & BIT0) != 0\n"));\r
     return FALSE;\r
@@ -222,10 +232,10 @@ InternalHstiIsValidTable (
   //\r
   // ErrorString might not be CHAR16 aligned.\r
   //\r
   //\r
   // ErrorString might not be CHAR16 aligned.\r
   //\r
-  CopyMem (&ErrorChar, ErrorString, sizeof(ErrorChar));\r
+  CopyMem (&ErrorChar, ErrorString, sizeof (ErrorChar));\r
   for (ErrorStringLength = 0; (ErrorChar != 0) && (ErrorStringLength < (ErrorStringSize/2)); ErrorStringLength++) {\r
     ErrorString++;\r
   for (ErrorStringLength = 0; (ErrorChar != 0) && (ErrorStringLength < (ErrorStringSize/2)); ErrorStringLength++) {\r
     ErrorString++;\r
-    CopyMem (&ErrorChar, ErrorString, sizeof(ErrorChar));\r
+    CopyMem (&ErrorChar, ErrorString, sizeof (ErrorChar));\r
   }\r
 \r
   //\r
   }\r
 \r
   //\r
@@ -235,6 +245,7 @@ InternalHstiIsValidTable (
     DEBUG ((DEBUG_ERROR, "ErrorString has no NUL CHAR\n"));\r
     return FALSE;\r
   }\r
     DEBUG ((DEBUG_ERROR, "ErrorString has no NUL CHAR\n"));\r
     return FALSE;\r
   }\r
+\r
   if (ErrorStringLength == (ErrorStringSize/2)) {\r
     DEBUG ((DEBUG_ERROR, "ErrorString Length incorrect\n"));\r
     return FALSE;\r
   if (ErrorStringLength == (ErrorStringSize/2)) {\r
     DEBUG ((DEBUG_ERROR, "ErrorString Length incorrect\n"));\r
     return FALSE;\r
@@ -262,48 +273,50 @@ InternalHstiIsValidTable (
 EFI_STATUS\r
 EFIAPI\r
 HstiLibSetTable (\r
 EFI_STATUS\r
 EFIAPI\r
 HstiLibSetTable (\r
-  IN VOID                     *Hsti,\r
-  IN UINTN                    HstiSize\r
+  IN VOID   *Hsti,\r
+  IN UINTN  HstiSize\r
   )\r
 {\r
   )\r
 {\r
-  EFI_STATUS                       Status;\r
-  EFI_HANDLE                       Handle;\r
-  HSTI_AIP_PRIVATE_DATA            *HstiAip;\r
-  EFI_ADAPTER_INFORMATION_PROTOCOL *Aip;\r
-  UINT32                           Role;\r
-  CHAR16                           *ImplementationID;\r
-  UINT32                           SecurityFeaturesSize;\r
-  UINT8                            *SecurityFeaturesRequired;\r
+  EFI_STATUS                        Status;\r
+  EFI_HANDLE                        Handle;\r
+  HSTI_AIP_PRIVATE_DATA             *HstiAip;\r
+  EFI_ADAPTER_INFORMATION_PROTOCOL  *Aip;\r
+  UINT32                            Role;\r
+  CHAR16                            *ImplementationID;\r
+  UINT32                            SecurityFeaturesSize;\r
+  UINT8                             *SecurityFeaturesRequired;\r
 \r
   if (!InternalHstiIsValidTable (Hsti, HstiSize)) {\r
     return EFI_VOLUME_CORRUPTED;\r
   }\r
 \r
 \r
   if (!InternalHstiIsValidTable (Hsti, HstiSize)) {\r
     return EFI_VOLUME_CORRUPTED;\r
   }\r
 \r
-  Role = ((ADAPTER_INFO_PLATFORM_SECURITY *)Hsti)->Role;\r
+  Role             = ((ADAPTER_INFO_PLATFORM_SECURITY *)Hsti)->Role;\r
   ImplementationID = ((ADAPTER_INFO_PLATFORM_SECURITY *)Hsti)->ImplementationID;\r
   ImplementationID = ((ADAPTER_INFO_PLATFORM_SECURITY *)Hsti)->ImplementationID;\r
-  Aip = InternalHstiFindAip (Role, ImplementationID, NULL, NULL);\r
+  Aip              = InternalHstiFindAip (Role, ImplementationID, NULL, NULL);\r
   if (Aip != NULL) {\r
     return EFI_ALREADY_STARTED;\r
   }\r
 \r
   if (Aip != NULL) {\r
     return EFI_ALREADY_STARTED;\r
   }\r
 \r
-  HstiAip = AllocateZeroPool (sizeof(HSTI_AIP_PRIVATE_DATA));\r
+  HstiAip = AllocateZeroPool (sizeof (HSTI_AIP_PRIVATE_DATA));\r
   if (HstiAip == NULL) {\r
     return EFI_OUT_OF_RESOURCES;\r
   }\r
   if (HstiAip == NULL) {\r
     return EFI_OUT_OF_RESOURCES;\r
   }\r
+\r
   HstiAip->Hsti = AllocateCopyPool (HstiSize, Hsti);\r
   if (HstiAip->Hsti == NULL) {\r
     FreePool (HstiAip);\r
     return EFI_OUT_OF_RESOURCES;\r
   }\r
   HstiAip->Hsti = AllocateCopyPool (HstiSize, Hsti);\r
   if (HstiAip->Hsti == NULL) {\r
     FreePool (HstiAip);\r
     return EFI_OUT_OF_RESOURCES;\r
   }\r
+\r
   if (Role != PLATFORM_SECURITY_ROLE_PLATFORM_REFERENCE) {\r
   if (Role != PLATFORM_SECURITY_ROLE_PLATFORM_REFERENCE) {\r
-    SecurityFeaturesRequired = (UINT8 *)HstiAip->Hsti + sizeof(ADAPTER_INFO_PLATFORM_SECURITY);\r
-    SecurityFeaturesSize = ((ADAPTER_INFO_PLATFORM_SECURITY *)Hsti)->SecurityFeaturesSize;\r
+    SecurityFeaturesRequired = (UINT8 *)HstiAip->Hsti + sizeof (ADAPTER_INFO_PLATFORM_SECURITY);\r
+    SecurityFeaturesSize     = ((ADAPTER_INFO_PLATFORM_SECURITY *)Hsti)->SecurityFeaturesSize;\r
     ZeroMem (SecurityFeaturesRequired, SecurityFeaturesSize);\r
   }\r
 \r
   HstiAip->Signature = HSTI_AIP_PRIVATE_SIGNATURE;\r
     ZeroMem (SecurityFeaturesRequired, SecurityFeaturesSize);\r
   }\r
 \r
   HstiAip->Signature = HSTI_AIP_PRIVATE_SIGNATURE;\r
-  CopyMem (&HstiAip->Aip, &mAdapterInformationProtocol, sizeof(EFI_ADAPTER_INFORMATION_PROTOCOL));\r
-  HstiAip->HstiSize = HstiSize;\r
+  CopyMem (&HstiAip->Aip, &mAdapterInformationProtocol, sizeof (EFI_ADAPTER_INFORMATION_PROTOCOL));\r
+  HstiAip->HstiSize    = HstiSize;\r
   HstiAip->HstiMaxSize = HstiSize;\r
 \r
   Handle = NULL;\r
   HstiAip->HstiMaxSize = HstiSize;\r
 \r
   Handle = NULL;\r
@@ -340,18 +353,19 @@ HstiLibSetTable (
 EFI_STATUS\r
 EFIAPI\r
 HstiLibGetTable (\r
 EFI_STATUS\r
 EFIAPI\r
 HstiLibGetTable (\r
-  IN UINT32                   Role,\r
-  IN CHAR16                   *ImplementationID OPTIONAL,\r
-  OUT VOID                    **Hsti,\r
-  OUT UINTN                   *HstiSize\r
+  IN UINT32  Role,\r
+  IN CHAR16  *ImplementationID OPTIONAL,\r
+  OUT VOID   **Hsti,\r
+  OUT UINTN  *HstiSize\r
   )\r
 {\r
   )\r
 {\r
-  EFI_ADAPTER_INFORMATION_PROTOCOL *Aip;\r
+  EFI_ADAPTER_INFORMATION_PROTOCOL  *Aip;\r
 \r
   Aip = InternalHstiFindAip (Role, ImplementationID, Hsti, HstiSize);\r
   if (Aip == NULL) {\r
     return EFI_NOT_FOUND;\r
   }\r
 \r
   Aip = InternalHstiFindAip (Role, ImplementationID, Hsti, HstiSize);\r
   if (Aip == NULL) {\r
     return EFI_NOT_FOUND;\r
   }\r
+\r
   return EFI_SUCCESS;\r
 }\r
 \r
   return EFI_SUCCESS;\r
 }\r
 \r
@@ -374,18 +388,18 @@ HstiLibGetTable (
 **/\r
 EFI_STATUS\r
 InternalHstiRecordFeaturesVerified (\r
 **/\r
 EFI_STATUS\r
 InternalHstiRecordFeaturesVerified (\r
-  IN UINT32                   Role,\r
-  IN CHAR16                   *ImplementationID  OPTIONAL,\r
-  IN UINT32                   ByteIndex,\r
-  IN UINT8                    Bit,\r
-  IN BOOLEAN                  Set\r
+  IN UINT32   Role,\r
+  IN CHAR16   *ImplementationID  OPTIONAL,\r
+  IN UINT32   ByteIndex,\r
+  IN UINT8    Bit,\r
+  IN BOOLEAN  Set\r
   )\r
 {\r
   )\r
 {\r
-  EFI_ADAPTER_INFORMATION_PROTOCOL *Aip;\r
-  ADAPTER_INFO_PLATFORM_SECURITY   *Hsti;\r
-  UINTN                            HstiSize;\r
-  UINT8                            *SecurityFeaturesVerified;\r
-  EFI_STATUS                       Status;\r
+  EFI_ADAPTER_INFORMATION_PROTOCOL  *Aip;\r
+  ADAPTER_INFO_PLATFORM_SECURITY    *Hsti;\r
+  UINTN                             HstiSize;\r
+  UINT8                             *SecurityFeaturesVerified;\r
+  EFI_STATUS                        Status;\r
 \r
   Aip = InternalHstiFindAip (Role, ImplementationID, (VOID **)&Hsti, &HstiSize);\r
   if (Aip == NULL) {\r
 \r
   Aip = InternalHstiFindAip (Role, ImplementationID, (VOID **)&Hsti, &HstiSize);\r
   if (Aip == NULL) {\r
@@ -396,7 +410,7 @@ InternalHstiRecordFeaturesVerified (
     return EFI_UNSUPPORTED;\r
   }\r
 \r
     return EFI_UNSUPPORTED;\r
   }\r
 \r
-  SecurityFeaturesVerified = (UINT8 *)((UINTN)Hsti + sizeof(ADAPTER_INFO_PLATFORM_SECURITY) + Hsti->SecurityFeaturesSize * 2);\r
+  SecurityFeaturesVerified = (UINT8 *)((UINTN)Hsti + sizeof (ADAPTER_INFO_PLATFORM_SECURITY) + Hsti->SecurityFeaturesSize * 2);\r
 \r
   if (Set) {\r
     SecurityFeaturesVerified[ByteIndex] = (UINT8)(SecurityFeaturesVerified[ByteIndex] | (Bit));\r
 \r
   if (Set) {\r
     SecurityFeaturesVerified[ByteIndex] = (UINT8)(SecurityFeaturesVerified[ByteIndex] | (Bit));\r
@@ -432,10 +446,10 @@ InternalHstiRecordFeaturesVerified (
 EFI_STATUS\r
 EFIAPI\r
 HstiLibSetFeaturesVerified (\r
 EFI_STATUS\r
 EFIAPI\r
 HstiLibSetFeaturesVerified (\r
-  IN UINT32                   Role,\r
-  IN CHAR16                   *ImplementationID  OPTIONAL,\r
-  IN UINT32                   ByteIndex,\r
-  IN UINT8                    BitMask\r
+  IN UINT32  Role,\r
+  IN CHAR16  *ImplementationID  OPTIONAL,\r
+  IN UINT32  ByteIndex,\r
+  IN UINT8   BitMask\r
   )\r
 {\r
   return InternalHstiRecordFeaturesVerified (\r
   )\r
 {\r
   return InternalHstiRecordFeaturesVerified (\r
@@ -465,10 +479,10 @@ HstiLibSetFeaturesVerified (
 EFI_STATUS\r
 EFIAPI\r
 HstiLibClearFeaturesVerified (\r
 EFI_STATUS\r
 EFIAPI\r
 HstiLibClearFeaturesVerified (\r
-  IN UINT32                   Role,\r
-  IN CHAR16                   *ImplementationID  OPTIONAL,\r
-  IN UINT32                   ByteIndex,\r
-  IN UINT8                    BitMask\r
+  IN UINT32  Role,\r
+  IN CHAR16  *ImplementationID  OPTIONAL,\r
+  IN UINT32  ByteIndex,\r
+  IN UINT8   BitMask\r
   )\r
 {\r
   return InternalHstiRecordFeaturesVerified (\r
   )\r
 {\r
   return InternalHstiRecordFeaturesVerified (\r
@@ -498,20 +512,20 @@ HstiLibClearFeaturesVerified (
 **/\r
 EFI_STATUS\r
 InternalHstiRecordErrorString (\r
 **/\r
 EFI_STATUS\r
 InternalHstiRecordErrorString (\r
-  IN UINT32                   Role,\r
-  IN CHAR16                   *ImplementationID  OPTIONAL,\r
-  IN CHAR16                   *ErrorString,\r
-  IN BOOLEAN                  Append\r
+  IN UINT32   Role,\r
+  IN CHAR16   *ImplementationID  OPTIONAL,\r
+  IN CHAR16   *ErrorString,\r
+  IN BOOLEAN  Append\r
   )\r
 {\r
   )\r
 {\r
-  EFI_ADAPTER_INFORMATION_PROTOCOL *Aip;\r
-  ADAPTER_INFO_PLATFORM_SECURITY   *Hsti;\r
-  UINTN                            HstiSize;\r
-  UINTN                            StringSize;\r
-  VOID                             *NewHsti;\r
-  UINTN                            NewHstiSize;\r
-  UINTN                            Offset;\r
-  EFI_STATUS                       Status;\r
+  EFI_ADAPTER_INFORMATION_PROTOCOL  *Aip;\r
+  ADAPTER_INFO_PLATFORM_SECURITY    *Hsti;\r
+  UINTN                             HstiSize;\r
+  UINTN                             StringSize;\r
+  VOID                              *NewHsti;\r
+  UINTN                             NewHstiSize;\r
+  UINTN                             Offset;\r
+  EFI_STATUS                        Status;\r
 \r
   Aip = InternalHstiFindAip (Role, ImplementationID, (VOID **)&Hsti, &HstiSize);\r
   if (Aip == NULL) {\r
 \r
   Aip = InternalHstiFindAip (Role, ImplementationID, (VOID **)&Hsti, &HstiSize);\r
   if (Aip == NULL) {\r
@@ -519,14 +533,15 @@ InternalHstiRecordErrorString (
   }\r
 \r
   if (Append) {\r
   }\r
 \r
   if (Append) {\r
-    Offset = HstiSize - sizeof(CHAR16);\r
+    Offset = HstiSize - sizeof (CHAR16);\r
   } else {\r
   } else {\r
-    Offset = sizeof(ADAPTER_INFO_PLATFORM_SECURITY) + Hsti->SecurityFeaturesSize * 3;\r
+    Offset = sizeof (ADAPTER_INFO_PLATFORM_SECURITY) + Hsti->SecurityFeaturesSize * 3;\r
   }\r
   }\r
+\r
   StringSize = StrSize (ErrorString);\r
 \r
   NewHstiSize = Offset + StringSize;\r
   StringSize = StrSize (ErrorString);\r
 \r
   NewHstiSize = Offset + StringSize;\r
-  NewHsti = AllocatePool (NewHstiSize);\r
+  NewHsti     = AllocatePool (NewHstiSize);\r
   if (NewHsti == NULL) {\r
     return EFI_OUT_OF_RESOURCES;\r
   }\r
   if (NewHsti == NULL) {\r
     return EFI_OUT_OF_RESOURCES;\r
   }\r
@@ -562,9 +577,9 @@ InternalHstiRecordErrorString (
 EFI_STATUS\r
 EFIAPI\r
 HstiLibAppendErrorString (\r
 EFI_STATUS\r
 EFIAPI\r
 HstiLibAppendErrorString (\r
-  IN UINT32                   Role,\r
-  IN CHAR16                   *ImplementationID  OPTIONAL,\r
-  IN CHAR16                   *ErrorString\r
+  IN UINT32  Role,\r
+  IN CHAR16  *ImplementationID  OPTIONAL,\r
+  IN CHAR16  *ErrorString\r
   )\r
 {\r
   return InternalHstiRecordErrorString (\r
   )\r
 {\r
   return InternalHstiRecordErrorString (\r
@@ -592,9 +607,9 @@ HstiLibAppendErrorString (
 EFI_STATUS\r
 EFIAPI\r
 HstiLibSetErrorString (\r
 EFI_STATUS\r
 EFIAPI\r
 HstiLibSetErrorString (\r
-  IN UINT32                   Role,\r
-  IN CHAR16                   *ImplementationID  OPTIONAL,\r
-  IN CHAR16                   *ErrorString\r
+  IN UINT32  Role,\r
+  IN CHAR16  *ImplementationID  OPTIONAL,\r
+  IN CHAR16  *ErrorString\r
   )\r
 {\r
   return InternalHstiRecordErrorString (\r
   )\r
 {\r
   return InternalHstiRecordErrorString (\r