diff options
author | Michael D Kinney <michael.d.kinney@intel.com> | 2021-12-05 14:33:53 -0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2021-12-07 17:24:28 +0000 |
commit | db52c7f755885d2f42279ba0d967c5d646d017b1 (patch) | |
tree | 07e0902972606385aba6c20cf36829fdd76a23db /MdeModulePkg/Universal | |
parent | 4a9d41166224346621981ce98add027d56901b53 (diff) | |
download | edk2-db52c7f755885d2f42279ba0d967c5d646d017b1.zip edk2-db52c7f755885d2f42279ba0d967c5d646d017b1.tar.gz edk2-db52c7f755885d2f42279ba0d967c5d646d017b1.tar.bz2 |
MdeModulePkg: Change complex DEBUG_CODE() to DEBUG_CODE_BEGIN/END()
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: Liming Gao <gaoliming@byosoft.com.cn>
Diffstat (limited to 'MdeModulePkg/Universal')
9 files changed, 20 insertions, 22 deletions
diff --git a/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/IA32/SetIdtEntry.c b/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/IA32/SetIdtEntry.c index 1e3c5b8..45c9b66 100644 --- a/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/IA32/SetIdtEntry.c +++ b/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/IA32/SetIdtEntry.c @@ -38,7 +38,7 @@ SetIdtEntry ( Status = InitializeCpuExceptionHandlers (NULL);
ASSERT_EFI_ERROR (Status);
- DEBUG_CODE (
+ DEBUG_CODE_BEGIN ();
//
// Update IDT entry INT3 if the instruction is valid in it
//
@@ -51,6 +51,5 @@ SetIdtEntry ( IdtEntry->Bits.GateType = IA32_IDT_GATE_TYPE_INTERRUPT_32;
IdtEntry->Bits.OffsetHigh = (UINT16)(S3DebugBuffer >> 16);
}
- );
+ DEBUG_CODE_END ();
}
-
diff --git a/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/X64/SetIdtEntry.c b/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/X64/SetIdtEntry.c index 0d448cc..afb2d5c 100644 --- a/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/X64/SetIdtEntry.c +++ b/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/X64/SetIdtEntry.c @@ -149,7 +149,7 @@ SetIdtEntry ( Status = InitializeCpuExceptionHandlers (NULL);
ASSERT_EFI_ERROR (Status);
- DEBUG_CODE (
+ DEBUG_CODE_BEGIN ();
//
// Update IDT entry INT3 if the instruction is valid in it
//
@@ -164,7 +164,7 @@ SetIdtEntry ( IdtEntry->Bits.OffsetUpper = (UINT32)(S3DebugBuffer >> 32);
IdtEntry->Bits.Reserved_1 = 0;
}
- );
+ DEBUG_CODE_END ();
//
// If both BIOS and OS wants long mode waking vector,
diff --git a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c index 4b10567..f705316 100644 --- a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c +++ b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c @@ -941,7 +941,7 @@ BdsEntry ( OsIndication = 0;
}
- DEBUG_CODE (
+ DEBUG_CODE_BEGIN ();
EFI_BOOT_MANAGER_LOAD_OPTION_TYPE LoadOptionType;
DEBUG ((DEBUG_INFO, "[Bds]OsIndication: %016x\n", OsIndication));
DEBUG ((DEBUG_INFO, "[Bds]=============Begin Load Options Dumping ...=============\n"));
@@ -963,7 +963,7 @@ BdsEntry ( EfiBootManagerFreeLoadOptions (LoadOptions, LoadOptionCount);
}
DEBUG ((DEBUG_INFO, "[Bds]=============End Load Options Dumping=============\n"));
- );
+ DEBUG_CODE_END ();
//
// BootManagerMenu doesn't contain the correct information when return status is EFI_NOT_FOUND.
diff --git a/MdeModulePkg/Universal/CapsuleOnDiskLoadPei/CapsuleOnDiskLoadPei.c b/MdeModulePkg/Universal/CapsuleOnDiskLoadPei/CapsuleOnDiskLoadPei.c index e9b1250..aedbc66 100644 --- a/MdeModulePkg/Universal/CapsuleOnDiskLoadPei/CapsuleOnDiskLoadPei.c +++ b/MdeModulePkg/Universal/CapsuleOnDiskLoadPei/CapsuleOnDiskLoadPei.c @@ -282,7 +282,7 @@ InitializeCapsuleOnDiskLoad ( return EFI_ABORTED;
}
- DEBUG_CODE (
+ DEBUG_CODE_BEGIN ();
VOID *CapsuleOnDiskModePpi;
if (!IsCapsuleOnDiskMode()){
@@ -302,7 +302,7 @@ InitializeCapsuleOnDiskLoad ( DEBUG((DEBUG_ERROR, "Locate CapsuleOnDiskModePpi error %x\n", Status));
return Status;
}
- );
+ DEBUG_CODE_END ();
Status = PeiServicesInstallPpi (&mCapsuleOnDiskPpiList);
ASSERT_EFI_ERROR (Status);
diff --git a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c index 838c333..50c4d71 100644 --- a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c +++ b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c @@ -335,12 +335,12 @@ InitializeGraphicsConsoleTextMode ( }
}
- DEBUG_CODE (
+ DEBUG_CODE_BEGIN ();
for (Index = 0; Index < ValidCount; Index++) {
DEBUG ((DEBUG_INFO, "Graphics - Mode %d, Column = %d, Row = %d\n",
Index, NewModeBuffer[Index].Columns, NewModeBuffer[Index].Rows));
}
- );
+ DEBUG_CODE_END ();
//
// Return valid mode count and mode information buffer.
diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c index a98b690..89d6e72 100644 --- a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c +++ b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c @@ -327,13 +327,13 @@ InitializeTerminalConsoleTextMode ( }
*TextModeCount = ARRAY_SIZE (mTerminalConsoleModeData);
- DEBUG_CODE (
+ DEBUG_CODE_BEGIN ();
INT32 Index;
for (Index = 0; Index < *TextModeCount; Index++) {
DEBUG ((DEBUG_INFO, "Terminal - Mode %d, Column = %d, Row = %d\n",
Index, TextModeData[Index].Columns, TextModeData[Index].Rows));
}
- );
+ DEBUG_CODE_END ();
return TextModeData;
}
@@ -1380,4 +1380,3 @@ IsHotPlugDevice ( return FALSE;
}
-
diff --git a/MdeModulePkg/Universal/SecurityStubDxe/Defer3rdPartyImageLoad.c b/MdeModulePkg/Universal/SecurityStubDxe/Defer3rdPartyImageLoad.c index 6a5f4a3..dfa680b 100644 --- a/MdeModulePkg/Universal/SecurityStubDxe/Defer3rdPartyImageLoad.c +++ b/MdeModulePkg/Universal/SecurityStubDxe/Defer3rdPartyImageLoad.c @@ -330,7 +330,7 @@ Defer3rdPartyImageLoad ( ImageInfo = LookupImage (File, BootPolicy);
- DEBUG_CODE (
+ DEBUG_CODE_BEGIN ();
CHAR16 *DevicePathStr;
DevicePathStr = ConvertDevicePathToText (File, FALSE, FALSE);
DEBUG ((
@@ -342,7 +342,7 @@ Defer3rdPartyImageLoad ( if (DevicePathStr != NULL) {
FreePool (DevicePathStr);
}
- );
+ DEBUG_CODE_END ();
if (mEndOfDxe) {
mImageLoadedAfterEndOfDxe = TRUE;
diff --git a/MdeModulePkg/Universal/Variable/Pei/Variable.c b/MdeModulePkg/Universal/Variable/Pei/Variable.c index 468b732..7e4fa60 100644 --- a/MdeModulePkg/Universal/Variable/Pei/Variable.c +++ b/MdeModulePkg/Universal/Variable/Pei/Variable.c @@ -512,7 +512,7 @@ GetHobVariableStore ( //
// Make sure there is no more than one Variable HOB.
//
- DEBUG_CODE (
+ DEBUG_CODE_BEGIN ();
GuidHob = GetFirstGuidHob (&gEfiAuthenticatedVariableGuid);
if (GuidHob != NULL) {
if ((GetNextGuidHob (&gEfiAuthenticatedVariableGuid, GET_NEXT_HOB (GuidHob)) != NULL)) {
@@ -531,7 +531,7 @@ GetHobVariableStore ( }
}
}
- );
+ DEBUG_CODE_END ();
GuidHob = GetFirstGuidHob (&gEfiAuthenticatedVariableGuid);
if (GuidHob != NULL) {
diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c index 5115bcf..adb3e97 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c @@ -280,7 +280,7 @@ RecordVarErrorFlag ( VAR_ERROR_FLAG *VarErrFlag;
VAR_ERROR_FLAG TempFlag;
- DEBUG_CODE (
+ DEBUG_CODE_BEGIN ();
DEBUG ((DEBUG_ERROR, "RecordVarErrorFlag (0x%02x) %s:%g - 0x%08x - 0x%x\n", Flag, VariableName, VendorGuid, Attributes, VariableSize));
if (Flag == VAR_ERROR_FLAG_SYSTEM_ERROR) {
if (AtRuntime ()) {
@@ -291,7 +291,7 @@ RecordVarErrorFlag ( } else {
DEBUG ((DEBUG_ERROR, "CommonMaxUserVariableSpace = 0x%x - CommonUserVariableTotalSize = 0x%x\n", mVariableModuleGlobal->CommonMaxUserVariableSpace, mVariableModuleGlobal->CommonUserVariableTotalSize));
}
- );
+ DEBUG_CODE_END ();
if (!mEndOfDxe) {
//
@@ -3498,7 +3498,7 @@ GetHobVariableStore ( //
// Make sure there is no more than one Variable HOB.
//
- DEBUG_CODE (
+ DEBUG_CODE_BEGIN ();
GuidHob = GetFirstGuidHob (&gEfiAuthenticatedVariableGuid);
if (GuidHob != NULL) {
if ((GetNextGuidHob (&gEfiAuthenticatedVariableGuid, GET_NEXT_HOB (GuidHob)) != NULL)) {
@@ -3517,7 +3517,7 @@ GetHobVariableStore ( }
}
}
- );
+ DEBUG_CODE_END ();
//
// Combinations supported:
|