]> git.proxmox.com Git - mirror_edk2.git/blobdiff - SecurityPkg/Library/TpmCommLib/TisPc.c
SecurityPkg: Apply uncrustify changes
[mirror_edk2.git] / SecurityPkg / Library / TpmCommLib / TisPc.c
index 533a42e53cee58c53b775cd92e85e40383d81070..20b5a21b3b3f52727a3a529949f1cf5ce14b2bdd 100644 (file)
@@ -18,10 +18,10 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 **/\r
 BOOLEAN\r
 TisPcPresenceCheck (\r
-  IN      TIS_PC_REGISTERS_PTR      TisReg\r
+  IN      TIS_PC_REGISTERS_PTR  TisReg\r
   )\r
 {\r
-  UINT8                             RegRead;\r
+  UINT8  RegRead;\r
 \r
   RegRead = MmioRead8 ((UINTN)&TisReg->Access);\r
   return (BOOLEAN)(RegRead != (UINT8)-1);\r
@@ -41,21 +41,24 @@ TisPcPresenceCheck (
 EFI_STATUS\r
 EFIAPI\r
 TisPcWaitRegisterBits (\r
-  IN      UINT8                     *Register,\r
-  IN      UINT8                     BitSet,\r
-  IN      UINT8                     BitClear,\r
-  IN      UINT32                    TimeOut\r
+  IN      UINT8   *Register,\r
+  IN      UINT8   BitSet,\r
+  IN      UINT8   BitClear,\r
+  IN      UINT32  TimeOut\r
   )\r
 {\r
-  UINT8                             RegRead;\r
-  UINT32                            WaitTime;\r
+  UINT8   RegRead;\r
+  UINT32  WaitTime;\r
 \r
-  for (WaitTime = 0; WaitTime < TimeOut; WaitTime += 30){\r
+  for (WaitTime = 0; WaitTime < TimeOut; WaitTime += 30) {\r
     RegRead = MmioRead8 ((UINTN)Register);\r
-    if ((RegRead & BitSet) == BitSet && (RegRead & BitClear) == 0)\r
+    if (((RegRead & BitSet) == BitSet) && ((RegRead & BitClear) == 0)) {\r
       return EFI_SUCCESS;\r
+    }\r
+\r
     MicroSecondDelay (30);\r
   }\r
+\r
   return EFI_TIMEOUT;\r
 }\r
 \r
@@ -73,15 +76,15 @@ TisPcWaitRegisterBits (
 EFI_STATUS\r
 EFIAPI\r
 TisPcReadBurstCount (\r
-  IN      TIS_PC_REGISTERS_PTR      TisReg,\r
-     OUT  UINT16                    *BurstCount\r
+  IN      TIS_PC_REGISTERS_PTR  TisReg,\r
+  OUT  UINT16                   *BurstCount\r
   )\r
 {\r
-  UINT32                            WaitTime;\r
-  UINT8                             DataByte0;\r
-  UINT8                             DataByte1;\r
+  UINT32  WaitTime;\r
+  UINT8   DataByte0;\r
+  UINT8   DataByte1;\r
 \r
-  if (BurstCount == NULL || TisReg == NULL) {\r
+  if ((BurstCount == NULL) || (TisReg == NULL)) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
@@ -97,6 +100,7 @@ TisPcReadBurstCount (
     if (*BurstCount != 0) {\r
       return EFI_SUCCESS;\r
     }\r
+\r
     MicroSecondDelay (30);\r
     WaitTime += 30;\r
   } while (WaitTime < TIS_TIMEOUT_D);\r
@@ -117,16 +121,16 @@ TisPcReadBurstCount (
 EFI_STATUS\r
 EFIAPI\r
 TisPcPrepareCommand (\r
-  IN      TIS_PC_REGISTERS_PTR      TisReg\r
+  IN      TIS_PC_REGISTERS_PTR  TisReg\r
   )\r
 {\r
-  EFI_STATUS                        Status;\r
+  EFI_STATUS  Status;\r
 \r
   if (TisReg == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
-  MmioWrite8((UINTN)&TisReg->Status, TIS_PC_STS_READY);\r
+  MmioWrite8 ((UINTN)&TisReg->Status, TIS_PC_STS_READY);\r
   Status = TisPcWaitRegisterBits (\r
              &TisReg->Status,\r
              TIS_PC_STS_READY,\r
@@ -150,10 +154,10 @@ TisPcPrepareCommand (
 EFI_STATUS\r
 EFIAPI\r
 TisPcRequestUseTpm (\r
-  IN      TIS_PC_REGISTERS_PTR      TisReg\r
+  IN      TIS_PC_REGISTERS_PTR  TisReg\r
   )\r
 {\r
-  EFI_STATUS                        Status;\r
+  EFI_STATUS  Status;\r
 \r
   if (TisReg == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
@@ -163,7 +167,7 @@ TisPcRequestUseTpm (
     return EFI_NOT_FOUND;\r
   }\r
 \r
-  MmioWrite8((UINTN)&TisReg->Access, TIS_PC_ACC_RQUUSE);\r
+  MmioWrite8 ((UINTN)&TisReg->Access, TIS_PC_ACC_RQUUSE);\r
   //\r
   // No locality set before, ACCESS_X.activeLocality MUST be valid within TIMEOUT_A\r
   //\r