diff options
author | Rebecca Cran <rebecca@bsdio.com> | 2023-04-06 13:49:41 -0600 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2023-04-10 14:19:57 +0000 |
commit | 8ba392687b6f7fcb6e333756edd090003c57402e (patch) | |
tree | 040194cbfaa73f764e86e050e9bc00b58e4fc60b /OvmfPkg/CpuHotplugSmm | |
parent | 089013a69724687f4051fc88367c9eb74def4284 (diff) | |
download | edk2-8ba392687b6f7fcb6e333756edd090003c57402e.zip edk2-8ba392687b6f7fcb6e333756edd090003c57402e.tar.gz edk2-8ba392687b6f7fcb6e333756edd090003c57402e.tar.bz2 |
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>
Diffstat (limited to 'OvmfPkg/CpuHotplugSmm')
-rw-r--r-- | OvmfPkg/CpuHotplugSmm/CpuHotplug.c | 40 | ||||
-rw-r--r-- | OvmfPkg/CpuHotplugSmm/QemuCpuhp.c | 32 | ||||
-rw-r--r-- | OvmfPkg/CpuHotplugSmm/Smbase.c | 10 |
3 files changed, 41 insertions, 41 deletions
diff --git a/OvmfPkg/CpuHotplugSmm/CpuHotplug.c b/OvmfPkg/CpuHotplugSmm/CpuHotplug.c index 97ecd32..d504163 100644 --- a/OvmfPkg/CpuHotplugSmm/CpuHotplug.c +++ b/OvmfPkg/CpuHotplugSmm/CpuHotplug.c @@ -135,7 +135,7 @@ ProcessHotAddedCpus ( DEBUG_VERBOSE,
"%a: APIC ID " FMT_APIC_ID " was hot-plugged "
"before; ignoring it\n",
- __FUNCTION__,
+ __func__,
NewApicId
));
PluggedIdx++;
@@ -155,7 +155,7 @@ ProcessHotAddedCpus ( DEBUG ((
DEBUG_ERROR,
"%a: no room for APIC ID " FMT_APIC_ID "\n",
- __FUNCTION__,
+ __func__,
NewApicId
));
return EFI_OUT_OF_RESOURCES;
@@ -190,7 +190,7 @@ ProcessHotAddedCpus ( DEBUG ((
DEBUG_ERROR,
"%a: AddProcessor(" FMT_APIC_ID "): %r\n",
- __FUNCTION__,
+ __func__,
NewApicId,
Status
));
@@ -201,7 +201,7 @@ ProcessHotAddedCpus ( DEBUG_INFO,
"%a: hot-added APIC ID " FMT_APIC_ID ", SMBASE 0x%Lx, "
"EFI_SMM_CPU_SERVICE_PROTOCOL assigned number %Lu\n",
- __FUNCTION__,
+ __func__,
NewApicId,
(UINT64)mCpuHotPlugData->SmBase[NewSlot],
(UINT64)NewProcessorNumberByProtocol
@@ -310,7 +310,7 @@ EjectCpu ( DEBUG_INFO,
"%a: Unplugged ProcessorNum %u, "
"QemuSelector %Lu\n",
- __FUNCTION__,
+ __func__,
Idx,
QemuSelector
));
@@ -454,7 +454,7 @@ UnplugCpus ( DEBUG_VERBOSE,
"%a: did not find APIC ID " FMT_APIC_ID
" to unplug\n",
- __FUNCTION__,
+ __func__,
RemoveApicId
));
ToUnplugIdx++;
@@ -469,7 +469,7 @@ UnplugCpus ( DEBUG ((
DEBUG_ERROR,
"%a: RemoveProcessor(" FMT_APIC_ID "): %r\n",
- __FUNCTION__,
+ __func__,
RemoveApicId,
Status
));
@@ -493,7 +493,7 @@ UnplugCpus ( DEBUG_ERROR,
"%a: ProcessorNum %Lu maps to QemuSelector %Lu, "
"cannot also map to %u\n",
- __FUNCTION__,
+ __func__,
(UINT64)ProcessorNum,
mCpuHotEjectData->QemuSelectorMap[ProcessorNum],
QemuSelector
@@ -511,7 +511,7 @@ UnplugCpus ( DEBUG_INFO,
"%a: Started hot-unplug on ProcessorNum %Lu, APIC ID "
FMT_APIC_ID ", QemuSelector %u\n",
- __FUNCTION__,
+ __func__,
(UINT64)ProcessorNum,
RemoveApicId,
QemuSelector
@@ -635,7 +635,7 @@ CpuHotplugMmi ( DEBUG ((
DEBUG_ERROR,
"%a: failed to read ICH9_APM_CNT: %r\n",
- __FUNCTION__,
+ __func__,
Status
));
//
@@ -736,7 +736,7 @@ CpuHotplugEntry ( (VOID **)&mMmCpuIo
);
if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "%a: locate MmCpuIo: %r\n", __FUNCTION__, Status));
+ DEBUG ((DEBUG_ERROR, "%a: locate MmCpuIo: %r\n", __func__, Status));
goto Fatal;
}
@@ -749,7 +749,7 @@ CpuHotplugEntry ( DEBUG ((
DEBUG_ERROR,
"%a: locate MmCpuService: %r\n",
- __FUNCTION__,
+ __func__,
Status
));
goto Fatal;
@@ -767,7 +767,7 @@ CpuHotplugEntry ( if (mCpuHotPlugData == NULL) {
Status = EFI_NOT_FOUND;
- DEBUG ((DEBUG_ERROR, "%a: CPU_HOT_PLUG_DATA: %r\n", __FUNCTION__, Status));
+ DEBUG ((DEBUG_ERROR, "%a: CPU_HOT_PLUG_DATA: %r\n", __func__, Status));
goto Fatal;
}
@@ -787,7 +787,7 @@ CpuHotplugEntry ( }
if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "%a: CPU_HOT_EJECT_DATA: %r\n", __FUNCTION__, Status));
+ DEBUG ((DEBUG_ERROR, "%a: CPU_HOT_EJECT_DATA: %r\n", __func__, Status));
goto Fatal;
}
@@ -799,7 +799,7 @@ CpuHotplugEntry ( RETURN_ERROR (SafeUintnMult (sizeof (UINT32), Len, &SizeSel)))
{
Status = EFI_ABORTED;
- DEBUG ((DEBUG_ERROR, "%a: invalid CPU_HOT_PLUG_DATA\n", __FUNCTION__));
+ DEBUG ((DEBUG_ERROR, "%a: invalid CPU_HOT_PLUG_DATA\n", __func__));
goto Fatal;
}
@@ -809,7 +809,7 @@ CpuHotplugEntry ( (VOID **)&mPluggedApicIds
);
if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "%a: MmAllocatePool(): %r\n", __FUNCTION__, Status));
+ DEBUG ((DEBUG_ERROR, "%a: MmAllocatePool(): %r\n", __func__, Status));
goto Fatal;
}
@@ -819,7 +819,7 @@ CpuHotplugEntry ( (VOID **)&mToUnplugApicIds
);
if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "%a: MmAllocatePool(): %r\n", __FUNCTION__, Status));
+ DEBUG ((DEBUG_ERROR, "%a: MmAllocatePool(): %r\n", __func__, Status));
goto ReleasePluggedApicIds;
}
@@ -829,7 +829,7 @@ CpuHotplugEntry ( (VOID **)&mToUnplugSelectors
);
if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "%a: MmAllocatePool(): %r\n", __FUNCTION__, Status));
+ DEBUG ((DEBUG_ERROR, "%a: MmAllocatePool(): %r\n", __func__, Status));
goto ReleaseToUnplugApicIds;
}
@@ -874,7 +874,7 @@ CpuHotplugEntry ( DEBUG ((
DEBUG_ERROR,
"%a: modern CPU hotplug interface: %r\n",
- __FUNCTION__,
+ __func__,
Status
));
goto ReleasePostSmmPen;
@@ -892,7 +892,7 @@ CpuHotplugEntry ( DEBUG ((
DEBUG_ERROR,
"%a: MmiHandlerRegister(): %r\n",
- __FUNCTION__,
+ __func__,
Status
));
goto ReleasePostSmmPen;
diff --git a/OvmfPkg/CpuHotplugSmm/QemuCpuhp.c b/OvmfPkg/CpuHotplugSmm/QemuCpuhp.c index ec3dc37..1687dad 100644 --- a/OvmfPkg/CpuHotplugSmm/QemuCpuhp.c +++ b/OvmfPkg/CpuHotplugSmm/QemuCpuhp.c @@ -36,7 +36,7 @@ QemuCpuhpReadCommandData2 ( &CommandData2
);
if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "%a: %r\n", __FUNCTION__, Status));
+ DEBUG ((DEBUG_ERROR, "%a: %r\n", __func__, Status));
ASSERT (FALSE);
CpuDeadLoop ();
}
@@ -61,7 +61,7 @@ QemuCpuhpReadCpuStatus ( &CpuStatus
);
if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "%a: %r\n", __FUNCTION__, Status));
+ DEBUG ((DEBUG_ERROR, "%a: %r\n", __func__, Status));
ASSERT (FALSE);
CpuDeadLoop ();
}
@@ -86,7 +86,7 @@ QemuCpuhpReadCommandData ( &CommandData
);
if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "%a: %r\n", __FUNCTION__, Status));
+ DEBUG ((DEBUG_ERROR, "%a: %r\n", __func__, Status));
ASSERT (FALSE);
CpuDeadLoop ();
}
@@ -110,7 +110,7 @@ QemuCpuhpWriteCpuSelector ( &Selector
);
if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "%a: %r\n", __FUNCTION__, Status));
+ DEBUG ((DEBUG_ERROR, "%a: %r\n", __func__, Status));
ASSERT (FALSE);
CpuDeadLoop ();
}
@@ -132,7 +132,7 @@ QemuCpuhpWriteCpuStatus ( &CpuStatus
);
if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "%a: %r\n", __FUNCTION__, Status));
+ DEBUG ((DEBUG_ERROR, "%a: %r\n", __func__, Status));
ASSERT (FALSE);
CpuDeadLoop ();
}
@@ -154,7 +154,7 @@ QemuCpuhpWriteCommand ( &Command
);
if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "%a: %r\n", __FUNCTION__, Status));
+ DEBUG ((DEBUG_ERROR, "%a: %r\n", __func__, Status));
ASSERT (FALSE);
CpuDeadLoop ();
}
@@ -266,7 +266,7 @@ QemuCpuhpCollectApicIds ( DEBUG_VERBOSE,
"%a: CurrentSelector=%u PendingSelector=%u: "
"wrap-around\n",
- __FUNCTION__,
+ __func__,
CurrentSelector,
PendingSelector
));
@@ -291,7 +291,7 @@ QemuCpuhpCollectApicIds ( DEBUG_ERROR,
"%a: CurrentSelector=%u CpuStatus=0x%x: "
"inconsistent CPU status\n",
- __FUNCTION__,
+ __func__,
CurrentSelector,
CpuStatus
));
@@ -301,7 +301,7 @@ QemuCpuhpCollectApicIds ( DEBUG ((
DEBUG_VERBOSE,
"%a: CurrentSelector=%u: insert\n",
- __FUNCTION__,
+ __func__,
CurrentSelector
));
@@ -317,7 +317,7 @@ QemuCpuhpCollectApicIds ( DEBUG_ERROR,
"%a: CurrentSelector=%u CpuStatus=0x%x: "
"inconsistent CPU status\n",
- __FUNCTION__,
+ __func__,
CurrentSelector,
CpuStatus
));
@@ -327,7 +327,7 @@ QemuCpuhpCollectApicIds ( DEBUG ((
DEBUG_VERBOSE,
"%a: CurrentSelector=%u: fw_remove\n",
- __FUNCTION__,
+ __func__,
CurrentSelector
));
@@ -341,7 +341,7 @@ QemuCpuhpCollectApicIds ( DEBUG ((
DEBUG_VERBOSE,
"%a: CurrentSelector=%u: remove (ignored)\n",
- __FUNCTION__,
+ __func__,
CurrentSelector
));
@@ -352,7 +352,7 @@ QemuCpuhpCollectApicIds ( DEBUG ((
DEBUG_VERBOSE,
"%a: CurrentSelector=%u: no event\n",
- __FUNCTION__,
+ __func__,
CurrentSelector
));
break;
@@ -368,7 +368,7 @@ QemuCpuhpCollectApicIds ( // For unplug events, also save the CurrentSelector.
//
if (*ExtendCount == ApicIdCount) {
- DEBUG ((DEBUG_ERROR, "%a: APIC ID array too small\n", __FUNCTION__));
+ DEBUG ((DEBUG_ERROR, "%a: APIC ID array too small\n", __func__));
return EFI_BUFFER_TOO_SMALL;
}
@@ -377,7 +377,7 @@ QemuCpuhpCollectApicIds ( DEBUG ((
DEBUG_VERBOSE,
"%a: ApicId=" FMT_APIC_ID "\n",
- __FUNCTION__,
+ __func__,
NewApicId
));
if (ExtendSels != NULL) {
@@ -399,7 +399,7 @@ QemuCpuhpCollectApicIds ( DEBUG ((
DEBUG_VERBOSE,
"%a: PluggedCount=%u ToUnplugCount=%u\n",
- __FUNCTION__,
+ __func__,
*PluggedCount,
*ToUnplugCount
));
diff --git a/OvmfPkg/CpuHotplugSmm/Smbase.c b/OvmfPkg/CpuHotplugSmm/Smbase.c index 5d50605..dc6f4f4 100644 --- a/OvmfPkg/CpuHotplugSmm/Smbase.c +++ b/OvmfPkg/CpuHotplugSmm/Smbase.c @@ -62,7 +62,7 @@ SmbaseAllocatePostSmmPen ( DEBUG ((
DEBUG_ERROR,
"%a: mPostSmmPenSize=%u: %r\n",
- __FUNCTION__,
+ __func__,
mPostSmmPenSize,
Status
));
@@ -77,11 +77,11 @@ SmbaseAllocatePostSmmPen ( &Address
);
if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "%a: AllocatePages(): %r\n", __FUNCTION__, Status));
+ DEBUG ((DEBUG_ERROR, "%a: AllocatePages(): %r\n", __func__, Status));
return Status;
}
- DEBUG ((DEBUG_INFO, "%a: Post-SMM Pen at 0x%Lx\n", __FUNCTION__, Address));
+ DEBUG ((DEBUG_INFO, "%a: Post-SMM Pen at 0x%Lx\n", __func__, Address));
*PenAddress = (UINT32)Address;
return EFI_SUCCESS;
}
@@ -211,7 +211,7 @@ SmbaseRelocate ( DEBUG ((
DEBUG_ERROR,
"%a: ApicId=" FMT_APIC_ID " Smbase=0x%Lx: %r\n",
- __FUNCTION__,
+ __func__,
ApicId,
(UINT64)Smbase,
Status
@@ -289,7 +289,7 @@ SmbaseRelocate ( DEBUG ((
DEBUG_ERROR,
"%a: ApicId=" FMT_APIC_ID " ApicIdGate=0x%Lx: %r\n",
- __FUNCTION__,
+ __func__,
ApicId,
ExchangeResult,
Status
|