summaryrefslogtreecommitdiff
path: root/SecurityPkg/Library/TpmCommLib
diff options
context:
space:
mode:
authorMichael Kubacki <michael.kubacki@microsoft.com>2021-12-05 14:54:12 -0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-12-07 17:24:28 +0000
commitc411b485b63a671a1e276700cff025c73997233c (patch)
treee7a57ca51b659161ab4bc9da95e988760ec57e7a /SecurityPkg/Library/TpmCommLib
parent39de741e2dcb8f11e9b4438e37224797643d8451 (diff)
downloadedk2-c411b485b63a671a1e276700cff025c73997233c.zip
edk2-c411b485b63a671a1e276700cff025c73997233c.tar.gz
edk2-c411b485b63a671a1e276700cff025c73997233c.tar.bz2
SecurityPkg: Apply uncrustify changes
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the SecurityPkg package Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Diffstat (limited to 'SecurityPkg/Library/TpmCommLib')
-rw-r--r--SecurityPkg/Library/TpmCommLib/TisPc.c48
-rw-r--r--SecurityPkg/Library/TpmCommLib/TpmComm.c11
2 files changed, 31 insertions, 28 deletions
diff --git a/SecurityPkg/Library/TpmCommLib/TisPc.c b/SecurityPkg/Library/TpmCommLib/TisPc.c
index 533a42e..20b5a21 100644
--- a/SecurityPkg/Library/TpmCommLib/TisPc.c
+++ b/SecurityPkg/Library/TpmCommLib/TisPc.c
@@ -18,10 +18,10 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
**/
BOOLEAN
TisPcPresenceCheck (
- IN TIS_PC_REGISTERS_PTR TisReg
+ IN TIS_PC_REGISTERS_PTR TisReg
)
{
- UINT8 RegRead;
+ UINT8 RegRead;
RegRead = MmioRead8 ((UINTN)&TisReg->Access);
return (BOOLEAN)(RegRead != (UINT8)-1);
@@ -41,21 +41,24 @@ TisPcPresenceCheck (
EFI_STATUS
EFIAPI
TisPcWaitRegisterBits (
- IN UINT8 *Register,
- IN UINT8 BitSet,
- IN UINT8 BitClear,
- IN UINT32 TimeOut
+ IN UINT8 *Register,
+ IN UINT8 BitSet,
+ IN UINT8 BitClear,
+ IN UINT32 TimeOut
)
{
- UINT8 RegRead;
- UINT32 WaitTime;
+ UINT8 RegRead;
+ UINT32 WaitTime;
- for (WaitTime = 0; WaitTime < TimeOut; WaitTime += 30){
+ for (WaitTime = 0; WaitTime < TimeOut; WaitTime += 30) {
RegRead = MmioRead8 ((UINTN)Register);
- if ((RegRead & BitSet) == BitSet && (RegRead & BitClear) == 0)
+ if (((RegRead & BitSet) == BitSet) && ((RegRead & BitClear) == 0)) {
return EFI_SUCCESS;
+ }
+
MicroSecondDelay (30);
}
+
return EFI_TIMEOUT;
}
@@ -73,15 +76,15 @@ TisPcWaitRegisterBits (
EFI_STATUS
EFIAPI
TisPcReadBurstCount (
- IN TIS_PC_REGISTERS_PTR TisReg,
- OUT UINT16 *BurstCount
+ IN TIS_PC_REGISTERS_PTR TisReg,
+ OUT UINT16 *BurstCount
)
{
- UINT32 WaitTime;
- UINT8 DataByte0;
- UINT8 DataByte1;
+ UINT32 WaitTime;
+ UINT8 DataByte0;
+ UINT8 DataByte1;
- if (BurstCount == NULL || TisReg == NULL) {
+ if ((BurstCount == NULL) || (TisReg == NULL)) {
return EFI_INVALID_PARAMETER;
}
@@ -97,6 +100,7 @@ TisPcReadBurstCount (
if (*BurstCount != 0) {
return EFI_SUCCESS;
}
+
MicroSecondDelay (30);
WaitTime += 30;
} while (WaitTime < TIS_TIMEOUT_D);
@@ -117,16 +121,16 @@ TisPcReadBurstCount (
EFI_STATUS
EFIAPI
TisPcPrepareCommand (
- IN TIS_PC_REGISTERS_PTR TisReg
+ IN TIS_PC_REGISTERS_PTR TisReg
)
{
- EFI_STATUS Status;
+ EFI_STATUS Status;
if (TisReg == NULL) {
return EFI_INVALID_PARAMETER;
}
- MmioWrite8((UINTN)&TisReg->Status, TIS_PC_STS_READY);
+ MmioWrite8 ((UINTN)&TisReg->Status, TIS_PC_STS_READY);
Status = TisPcWaitRegisterBits (
&TisReg->Status,
TIS_PC_STS_READY,
@@ -150,10 +154,10 @@ TisPcPrepareCommand (
EFI_STATUS
EFIAPI
TisPcRequestUseTpm (
- IN TIS_PC_REGISTERS_PTR TisReg
+ IN TIS_PC_REGISTERS_PTR TisReg
)
{
- EFI_STATUS Status;
+ EFI_STATUS Status;
if (TisReg == NULL) {
return EFI_INVALID_PARAMETER;
@@ -163,7 +167,7 @@ TisPcRequestUseTpm (
return EFI_NOT_FOUND;
}
- MmioWrite8((UINTN)&TisReg->Access, TIS_PC_ACC_RQUUSE);
+ MmioWrite8 ((UINTN)&TisReg->Access, TIS_PC_ACC_RQUUSE);
//
// No locality set before, ACCESS_X.activeLocality MUST be valid within TIMEOUT_A
//
diff --git a/SecurityPkg/Library/TpmCommLib/TpmComm.c b/SecurityPkg/Library/TpmCommLib/TpmComm.c
index dee64b2..5285d72 100644
--- a/SecurityPkg/Library/TpmCommLib/TpmComm.c
+++ b/SecurityPkg/Library/TpmCommLib/TpmComm.c
@@ -21,13 +21,13 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
EFI_STATUS
EFIAPI
TpmCommHashAll (
- IN CONST UINT8 *Data,
- IN UINTN DataLen,
- OUT TPM_DIGEST *Digest
+ IN CONST UINT8 *Data,
+ IN UINTN DataLen,
+ OUT TPM_DIGEST *Digest
)
{
- VOID *Sha1Ctx;
- UINTN CtxSize;
+ VOID *Sha1Ctx;
+ UINTN CtxSize;
CtxSize = Sha1GetContextSize ();
Sha1Ctx = AllocatePool (CtxSize);
@@ -41,4 +41,3 @@ TpmCommHashAll (
return EFI_SUCCESS;
}
-