OvmfPkg: Update code to be more C11 compliant by using __func__

__FUNCTION__ is a pre-standard extension that gcc and Visual C++ among
others support, while __func__ was standardized in C99.

Since it's more standard, replace __FUNCTION__ with __func__ throughout
OvmfPkg.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
This commit is contained in:
Rebecca Cran
2023-04-06 13:49:41 -06:00
committed by mergify[bot]
parent 089013a697
commit 8ba392687b
123 changed files with 540 additions and 540 deletions

View File

@@ -193,7 +193,7 @@ FilterAndProcess (
DEBUG ((
DEBUG_VERBOSE,
"%a: %g: %r\n",
__FUNCTION__,
__func__,
ProtocolGuid,
Status
));
@@ -264,7 +264,7 @@ IsPciDisplay (
&Pci
);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "%a: %s: %r\n", __FUNCTION__, ReportText, Status));
DEBUG ((DEBUG_ERROR, "%a: %s: %r\n", __func__, ReportText, Status));
return FALSE;
}
@@ -413,7 +413,7 @@ IsVirtioPciRng (
return FALSE;
PciError:
DEBUG ((DEBUG_ERROR, "%a: %s: %r\n", __FUNCTION__, ReportText, Status));
DEBUG ((DEBUG_ERROR, "%a: %s: %r\n", __func__, ReportText, Status));
return FALSE;
}
@@ -440,7 +440,7 @@ Connect (
DEBUG ((
EFI_ERROR (Status) ? DEBUG_ERROR : DEBUG_VERBOSE,
"%a: %s: %r\n",
__FUNCTION__,
__func__,
ReportText,
Status
));
@@ -466,7 +466,7 @@ AddOutput (
DEBUG ((
DEBUG_ERROR,
"%a: %s: handle %p: device path not found\n",
__FUNCTION__,
__func__,
ReportText,
Handle
));
@@ -478,7 +478,7 @@ AddOutput (
DEBUG ((
DEBUG_ERROR,
"%a: %s: adding to ConOut: %r\n",
__FUNCTION__,
__func__,
ReportText,
Status
));
@@ -490,7 +490,7 @@ AddOutput (
DEBUG ((
DEBUG_ERROR,
"%a: %s: adding to ErrOut: %r\n",
__FUNCTION__,
__func__,
ReportText,
Status
));
@@ -500,7 +500,7 @@ AddOutput (
DEBUG ((
DEBUG_VERBOSE,
"%a: %s: added to ConOut and ErrOut\n",
__FUNCTION__,
__func__,
ReportText
));
}
@@ -701,7 +701,7 @@ RemoveStaleFvFileOptions (
DEBUG ((
EFI_ERROR (Status) ? DEBUG_WARN : DEBUG_VERBOSE,
"%a: removing stale Boot#%04x %s: %r\n",
__FUNCTION__,
__func__,
(UINT32)BootOptions[Index].OptionNumber,
DevicePathString == NULL ? L"<unavailable>" : DevicePathString,
Status
@@ -879,7 +879,7 @@ PlatformBootManagerBeforeConsole (
DEBUG ((
EFI_ERROR (Status) ? DEBUG_ERROR : DEBUG_VERBOSE,
"%a: SetVariable(%s, %u): %r\n",
__FUNCTION__,
__func__,
EFI_TIME_OUT_VARIABLE_NAME,
FrontPageTimeout,
Status

View File

@@ -66,7 +66,7 @@ TryRunningQemuKernel (
DEBUG ((
DEBUG_ERROR,
"%a: QemuStartKernelImage(): %r\n",
__FUNCTION__,
__func__,
Status
));
}

View File

@@ -31,7 +31,7 @@ PrePeiGetHobList (
GetFirmwareContextPointer (&FirmwareContext);
if (FirmwareContext == NULL) {
DEBUG ((DEBUG_ERROR, "%a: Firmware Context is NULL\n", __FUNCTION__));
DEBUG ((DEBUG_ERROR, "%a: Firmware Context is NULL\n", __func__));
return NULL;
}
@@ -56,7 +56,7 @@ PrePeiSetHobList (
GetFirmwareContextPointer (&FirmwareContext);
if (FirmwareContext == NULL) {
DEBUG ((DEBUG_ERROR, "%a: Firmware Context is NULL\n", __FUNCTION__));
DEBUG ((DEBUG_ERROR, "%a: Firmware Context is NULL\n", __func__));
return EFI_NOT_READY;
}

View File

@@ -97,7 +97,7 @@ InitMmu (
// Set supervisor translation mode to Bare mode
//
RiscVSetSupervisorAddressTranslationRegister ((UINT64)SATP_MODE_OFF << 60);
DEBUG ((DEBUG_INFO, "%a: Set Supervisor address mode to bare-metal mode.\n", __FUNCTION__));
DEBUG ((DEBUG_INFO, "%a: Set Supervisor address mode to bare-metal mode.\n", __func__));
}
/**
@@ -276,13 +276,13 @@ MemoryPeimInitialization (
GetFirmwareContextPointer (&FirmwareContext);
if (FirmwareContext == NULL) {
DEBUG ((DEBUG_ERROR, "%a: Firmware Context is NULL\n", __FUNCTION__));
DEBUG ((DEBUG_ERROR, "%a: Firmware Context is NULL\n", __func__));
return EFI_UNSUPPORTED;
}
FdtPointer = (VOID *)FirmwareContext->FlattenedDeviceTree;
if (FdtPointer == NULL) {
DEBUG ((DEBUG_ERROR, "%a: Invalid FDT pointer\n", __FUNCTION__));
DEBUG ((DEBUG_ERROR, "%a: Invalid FDT pointer\n", __func__));
return EFI_UNSUPPORTED;
}
@@ -306,7 +306,7 @@ MemoryPeimInitialization (
DEBUG ((
DEBUG_INFO,
"%a: System RAM @ 0x%lx - 0x%lx\n",
__FUNCTION__,
__func__,
CurBase,
CurBase + CurSize - 1
));
@@ -319,7 +319,7 @@ MemoryPeimInitialization (
DEBUG ((
DEBUG_ERROR,
"%a: Failed to parse FDT memory node\n",
__FUNCTION__
__func__
));
}
}

View File

@@ -43,20 +43,20 @@ PlatformPeimInitialization (
GetFirmwareContextPointer (&FirmwareContext);
if (FirmwareContext == NULL) {
DEBUG ((DEBUG_ERROR, "%a: Firmware Context is NULL\n", __FUNCTION__));
DEBUG ((DEBUG_ERROR, "%a: Firmware Context is NULL\n", __func__));
return EFI_UNSUPPORTED;
}
FdtPointer = (VOID *)FirmwareContext->FlattenedDeviceTree;
if (FdtPointer == NULL) {
DEBUG ((DEBUG_ERROR, "%a: Invalid FDT pointer\n", __FUNCTION__));
DEBUG ((DEBUG_ERROR, "%a: Invalid FDT pointer\n", __func__));
return EFI_UNSUPPORTED;
}
DEBUG ((DEBUG_INFO, "%a: Build FDT HOB - FDT at address: 0x%x \n", __FUNCTION__, FdtPointer));
DEBUG ((DEBUG_INFO, "%a: Build FDT HOB - FDT at address: 0x%x \n", __func__, FdtPointer));
Base = FdtPointer;
if (fdt_check_header (Base) != 0) {
DEBUG ((DEBUG_ERROR, "%a: Corrupted DTB\n", __FUNCTION__));
DEBUG ((DEBUG_ERROR, "%a: Corrupted DTB\n", __func__));
return EFI_UNSUPPORTED;
}
@@ -64,7 +64,7 @@ PlatformPeimInitialization (
FdtPages = EFI_SIZE_TO_PAGES (FdtSize);
NewBase = AllocatePages (FdtPages);
if (NewBase == NULL) {
DEBUG ((DEBUG_ERROR, "%a: Could not allocate memory for DTB\n", __FUNCTION__));
DEBUG ((DEBUG_ERROR, "%a: Could not allocate memory for DTB\n", __func__));
return EFI_UNSUPPORTED;
}
@@ -72,7 +72,7 @@ PlatformPeimInitialization (
FdtHobData = BuildGuidHob (&gFdtHobGuid, sizeof *FdtHobData);
if (FdtHobData == NULL) {
DEBUG ((DEBUG_ERROR, "%a: Could not build FDT Hob\n", __FUNCTION__));
DEBUG ((DEBUG_ERROR, "%a: Could not build FDT Hob\n", __func__));
return EFI_UNSUPPORTED;
}

View File

@@ -63,7 +63,7 @@ SecStartup (
DEBUG ((
DEBUG_INFO,
"%a() BootHartId: 0x%x, DeviceTreeAddress=0x%x\n",
__FUNCTION__,
__func__,
BootHartId,
DeviceTreeAddress
));