REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3767
Update use of DEBUG_CODE(Expression) if Expression is a complex code
block with if/while/for/case statements that use {}.
Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
UINT32 Data32;\r
UINT16 RspTag;\r
\r
UINT32 Data32;\r
UINT16 RspTag;\r
\r
UINTN DebugSize;\r
\r
DEBUG ((DEBUG_VERBOSE, "Tpm12TisTpmCommand Send - "));\r
UINTN DebugSize;\r
\r
DEBUG ((DEBUG_VERBOSE, "Tpm12TisTpmCommand Send - "));\r
}\r
}\r
DEBUG ((DEBUG_VERBOSE, "\n"));\r
}\r
}\r
DEBUG ((DEBUG_VERBOSE, "\n"));\r
TpmOutSize = 0;\r
\r
Status = Tpm12TisPcPrepareCommand (TisReg);\r
TpmOutSize = 0;\r
\r
Status = Tpm12TisPcPrepareCommand (TisReg);\r
if (Index == sizeof (TPM_RSP_COMMAND_HDR)) break;\r
}\r
}\r
if (Index == sizeof (TPM_RSP_COMMAND_HDR)) break;\r
}\r
}\r
DEBUG ((DEBUG_VERBOSE, "Tpm12TisTpmCommand ReceiveHeader - "));\r
for (Index = 0; Index < sizeof (TPM_RSP_COMMAND_HDR); Index++) {\r
DEBUG ((DEBUG_VERBOSE, "%02x ", BufferOut[Index]));\r
}\r
DEBUG ((DEBUG_VERBOSE, "\n"));\r
DEBUG ((DEBUG_VERBOSE, "Tpm12TisTpmCommand ReceiveHeader - "));\r
for (Index = 0; Index < sizeof (TPM_RSP_COMMAND_HDR); Index++) {\r
DEBUG ((DEBUG_VERBOSE, "%02x ", BufferOut[Index]));\r
}\r
DEBUG ((DEBUG_VERBOSE, "\n"));\r
//\r
// Check the response data header (tag, parasize and returncode)\r
//\r
//\r
// Check the response data header (tag, parasize and returncode)\r
//\r
DEBUG ((DEBUG_VERBOSE, "Tpm12TisTpmCommand Receive - "));\r
for (Index = 0; Index < TpmOutSize; Index++) {\r
DEBUG ((DEBUG_VERBOSE, "%02x ", BufferOut[Index]));\r
}\r
DEBUG ((DEBUG_VERBOSE, "\n"));\r
DEBUG ((DEBUG_VERBOSE, "Tpm12TisTpmCommand Receive - "));\r
for (Index = 0; Index < TpmOutSize; Index++) {\r
DEBUG ((DEBUG_VERBOSE, "%02x ", BufferOut[Index]));\r
}\r
DEBUG ((DEBUG_VERBOSE, "\n"));\r
MmioWrite8((UINTN)&TisReg->Status, TIS_PC_STS_READY);\r
return Status;\r
}\r
MmioWrite8((UINTN)&TisReg->Status, TIS_PC_STS_READY);\r
return Status;\r
}\r
UINT16 Data16;\r
UINT32 Data32;\r
\r
UINT16 Data16;\r
UINT32 Data32;\r
\r
UINTN DebugSize;\r
\r
DEBUG ((DEBUG_VERBOSE, "PtpCrbTpmCommand Send - "));\r
UINTN DebugSize;\r
\r
DEBUG ((DEBUG_VERBOSE, "PtpCrbTpmCommand Send - "));\r
}\r
}\r
DEBUG ((DEBUG_VERBOSE, "\n"));\r
}\r
}\r
DEBUG ((DEBUG_VERBOSE, "\n"));\r
TpmOutSize = 0;\r
\r
//\r
TpmOutSize = 0;\r
\r
//\r
for (Index = 0; Index < sizeof (TPM2_RESPONSE_HEADER); Index++) {\r
BufferOut[Index] = MmioRead8 ((UINTN)&CrbReg->CrbDataBuffer[Index]);\r
}\r
for (Index = 0; Index < sizeof (TPM2_RESPONSE_HEADER); Index++) {\r
BufferOut[Index] = MmioRead8 ((UINTN)&CrbReg->CrbDataBuffer[Index]);\r
}\r
DEBUG ((DEBUG_VERBOSE, "PtpCrbTpmCommand ReceiveHeader - "));\r
for (Index = 0; Index < sizeof (TPM2_RESPONSE_HEADER); Index++) {\r
DEBUG ((DEBUG_VERBOSE, "%02x ", BufferOut[Index]));\r
}\r
DEBUG ((DEBUG_VERBOSE, "\n"));\r
DEBUG ((DEBUG_VERBOSE, "PtpCrbTpmCommand ReceiveHeader - "));\r
for (Index = 0; Index < sizeof (TPM2_RESPONSE_HEADER); Index++) {\r
DEBUG ((DEBUG_VERBOSE, "%02x ", BufferOut[Index]));\r
}\r
DEBUG ((DEBUG_VERBOSE, "\n"));\r
//\r
// Check the response data header (tag, parasize and returncode)\r
//\r
//\r
// Check the response data header (tag, parasize and returncode)\r
//\r
BufferOut[Index] = MmioRead8 ((UINTN)&CrbReg->CrbDataBuffer[Index]);\r
}\r
\r
BufferOut[Index] = MmioRead8 ((UINTN)&CrbReg->CrbDataBuffer[Index]);\r
}\r
\r
DEBUG ((DEBUG_VERBOSE, "PtpCrbTpmCommand Receive - "));\r
for (Index = 0; Index < TpmOutSize; Index++) {\r
DEBUG ((DEBUG_VERBOSE, "%02x ", BufferOut[Index]));\r
}\r
DEBUG ((DEBUG_VERBOSE, "\n"));\r
DEBUG ((DEBUG_VERBOSE, "PtpCrbTpmCommand Receive - "));\r
for (Index = 0; Index < TpmOutSize; Index++) {\r
DEBUG ((DEBUG_VERBOSE, "%02x ", BufferOut[Index]));\r
}\r
DEBUG ((DEBUG_VERBOSE, "\n"));\r
UINT16 Data16;\r
UINT32 Data32;\r
\r
UINT16 Data16;\r
UINT32 Data32;\r
\r
UINTN DebugSize;\r
\r
DEBUG ((DEBUG_VERBOSE, "Tpm2TisTpmCommand Send - "));\r
UINTN DebugSize;\r
\r
DEBUG ((DEBUG_VERBOSE, "Tpm2TisTpmCommand Send - "));\r
}\r
}\r
DEBUG ((DEBUG_VERBOSE, "\n"));\r
}\r
}\r
DEBUG ((DEBUG_VERBOSE, "\n"));\r
TpmOutSize = 0;\r
\r
Status = TisPcPrepareCommand (TisReg);\r
TpmOutSize = 0;\r
\r
Status = TisPcPrepareCommand (TisReg);\r
if (Index == sizeof (TPM2_RESPONSE_HEADER)) break;\r
}\r
}\r
if (Index == sizeof (TPM2_RESPONSE_HEADER)) break;\r
}\r
}\r
DEBUG ((DEBUG_VERBOSE, "Tpm2TisTpmCommand ReceiveHeader - "));\r
for (Index = 0; Index < sizeof (TPM2_RESPONSE_HEADER); Index++) {\r
DEBUG ((DEBUG_VERBOSE, "%02x ", BufferOut[Index]));\r
}\r
DEBUG ((DEBUG_VERBOSE, "\n"));\r
DEBUG ((DEBUG_VERBOSE, "Tpm2TisTpmCommand ReceiveHeader - "));\r
for (Index = 0; Index < sizeof (TPM2_RESPONSE_HEADER); Index++) {\r
DEBUG ((DEBUG_VERBOSE, "%02x ", BufferOut[Index]));\r
}\r
DEBUG ((DEBUG_VERBOSE, "\n"));\r
//\r
// Check the response data header (tag,parasize and returncode )\r
//\r
//\r
// Check the response data header (tag,parasize and returncode )\r
//\r
DEBUG ((DEBUG_VERBOSE, "Tpm2TisTpmCommand Receive - "));\r
for (Index = 0; Index < TpmOutSize; Index++) {\r
DEBUG ((DEBUG_VERBOSE, "%02x ", BufferOut[Index]));\r
}\r
DEBUG ((DEBUG_VERBOSE, "\n"));\r
DEBUG ((DEBUG_VERBOSE, "Tpm2TisTpmCommand Receive - "));\r
for (Index = 0; Index < TpmOutSize; Index++) {\r
DEBUG ((DEBUG_VERBOSE, "%02x ", BufferOut[Index]));\r
}\r
DEBUG ((DEBUG_VERBOSE, "\n"));\r
MmioWrite8((UINTN)&TisReg->Status, TIS_PC_STS_READY);\r
return Status;\r
}\r
MmioWrite8((UINTN)&TisReg->Status, TIS_PC_STS_READY);\r
return Status;\r
}\r
DEBUG ((DEBUG_INFO, "Tpm2GetCapabilityManufactureID - %08x\n", mTcgDxeData.BsCap.ManufacturerID));\r
}\r
\r
DEBUG ((DEBUG_INFO, "Tpm2GetCapabilityManufactureID - %08x\n", mTcgDxeData.BsCap.ManufacturerID));\r
}\r
\r
UINT32 FirmwareVersion1;\r
UINT32 FirmwareVersion2;\r
\r
UINT32 FirmwareVersion1;\r
UINT32 FirmwareVersion2;\r
\r
} else {\r
DEBUG ((DEBUG_INFO, "Tpm2GetCapabilityFirmwareVersion - %08x %08x\n", FirmwareVersion1, FirmwareVersion2));\r
}\r
} else {\r
DEBUG ((DEBUG_INFO, "Tpm2GetCapabilityFirmwareVersion - %08x %08x\n", FirmwareVersion1, FirmwareVersion2));\r
}\r
\r
Status = Tpm2GetCapabilityMaxCommandResponseSize (&MaxCommandSize, &MaxResponseSize);\r
if (EFI_ERROR (Status)) {\r
\r
Status = Tpm2GetCapabilityMaxCommandResponseSize (&MaxCommandSize, &MaxResponseSize);\r
if (EFI_ERROR (Status)) {\r