summaryrefslogtreecommitdiffstats
path: root/SecurityPkg/Tcg/Tcg2Smm
diff options
context:
space:
mode:
authorRebecca Cran <rebecca@bsdio.com>2023-04-06 13:50:26 -0600
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-04-10 14:19:57 +0000
commitdd0b33e3e55957aecbae6aa5cebdc6c14e6e8932 (patch)
treeadcf42806767e4448a954218cccd9cade86dcacd /SecurityPkg/Tcg/Tcg2Smm
parent7b82da70edf7dda2c6f4e853f100df620bd5c0f3 (diff)
downloadedk2-dd0b33e3e55957aecbae6aa5cebdc6c14e6e8932.tar.gz
edk2-dd0b33e3e55957aecbae6aa5cebdc6c14e6e8932.tar.bz2
edk2-dd0b33e3e55957aecbae6aa5cebdc6c14e6e8932.zip
SecurityPkg: 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 SecurityPkg. 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>
Diffstat (limited to 'SecurityPkg/Tcg/Tcg2Smm')
-rw-r--r--SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c b/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c
index 498fb626bd..c47c582cc8 100644
--- a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c
+++ b/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c
@@ -57,7 +57,7 @@ TpmNvsCommunciate (
UINTN TempCommBufferSize;
TPM_NVS_MM_COMM_BUFFER *CommParams;
- DEBUG ((DEBUG_VERBOSE, "%a()\n", __FUNCTION__));
+ DEBUG ((DEBUG_VERBOSE, "%a()\n", __func__));
//
// If input is invalid, stop processing this SMI
@@ -69,12 +69,12 @@ TpmNvsCommunciate (
TempCommBufferSize = *CommBufferSize;
if (TempCommBufferSize != sizeof (TPM_NVS_MM_COMM_BUFFER)) {
- DEBUG ((DEBUG_ERROR, "[%a] MM Communication buffer size is invalid for this handler!\n", __FUNCTION__));
+ DEBUG ((DEBUG_ERROR, "[%a] MM Communication buffer size is invalid for this handler!\n", __func__));
return EFI_ACCESS_DENIED;
}
if (!IsBufferOutsideMmValid ((UINTN)CommBuffer, TempCommBufferSize)) {
- DEBUG ((DEBUG_ERROR, "[%a] - MM Communication buffer in invalid location!\n", __FUNCTION__));
+ DEBUG ((DEBUG_ERROR, "[%a] - MM Communication buffer in invalid location!\n", __func__));
return EFI_ACCESS_DENIED;
}
@@ -85,14 +85,14 @@ TpmNvsCommunciate (
Status = EFI_SUCCESS;
switch (CommParams->Function) {
case TpmNvsMmExchangeInfo:
- DEBUG ((DEBUG_VERBOSE, "[%a] - Function requested: MM_EXCHANGE_NVS_INFO\n", __FUNCTION__));
+ DEBUG ((DEBUG_VERBOSE, "[%a] - Function requested: MM_EXCHANGE_NVS_INFO\n", __func__));
CommParams->RegisteredPpSwiValue = mPpSoftwareSmi;
CommParams->RegisteredMcSwiValue = mMcSoftwareSmi;
mTcgNvs = (TCG_NVS *)(UINTN)CommParams->TargetAddress;
break;
default:
- DEBUG ((DEBUG_INFO, "[%a] - Unknown function %d!\n", __FUNCTION__, CommParams->Function));
+ DEBUG ((DEBUG_INFO, "[%a] - Unknown function %d!\n", __func__, CommParams->Function));
Status = EFI_UNSUPPORTED;
break;
}
@@ -301,7 +301,7 @@ InitializeTcgCommon (
Status = gMmst->MmiHandlerRegister (TpmNvsCommunciate, &gTpmNvsMmGuid, &mReadyToLockHandle);
ASSERT_EFI_ERROR (Status);
if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "[%a] Failed to register NVS communicate as root MM handler - %r!\n", __FUNCTION__, Status));
+ DEBUG ((DEBUG_ERROR, "[%a] Failed to register NVS communicate as root MM handler - %r!\n", __func__, Status));
goto Cleanup;
}
@@ -311,7 +311,7 @@ InitializeTcgCommon (
Status = gMmst->MmLocateProtocol (&gEfiSmmSwDispatch2ProtocolGuid, NULL, (VOID **)&SwDispatch);
ASSERT_EFI_ERROR (Status);
if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "[%a] Failed to locate Sw dispatch protocol - %r!\n", __FUNCTION__, Status));
+ DEBUG ((DEBUG_ERROR, "[%a] Failed to locate Sw dispatch protocol - %r!\n", __func__, Status));
goto Cleanup;
}
@@ -319,7 +319,7 @@ InitializeTcgCommon (
Status = SwDispatch->Register (SwDispatch, PhysicalPresenceCallback, &SwContext, &PpSwHandle);
ASSERT_EFI_ERROR (Status);
if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "[%a] Failed to register PP callback as SW MM handler - %r!\n", __FUNCTION__, Status));
+ DEBUG ((DEBUG_ERROR, "[%a] Failed to register PP callback as SW MM handler - %r!\n", __func__, Status));
goto Cleanup;
}
@@ -329,7 +329,7 @@ InitializeTcgCommon (
Status = SwDispatch->Register (SwDispatch, MemoryClearCallback, &SwContext, &McSwHandle);
ASSERT_EFI_ERROR (Status);
if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "[%a] Failed to register MC callback as SW MM handler - %r!\n", __FUNCTION__, Status));
+ DEBUG ((DEBUG_ERROR, "[%a] Failed to register MC callback as SW MM handler - %r!\n", __func__, Status));
goto Cleanup;
}
@@ -342,7 +342,7 @@ InitializeTcgCommon (
ASSERT_EFI_ERROR (Status);
if (EFI_ERROR (Status)) {
// Should not happen
- DEBUG ((DEBUG_ERROR, "[%a] Failed to locate SMM variable protocol - %r!\n", __FUNCTION__, Status));
+ DEBUG ((DEBUG_ERROR, "[%a] Failed to locate SMM variable protocol - %r!\n", __func__, Status));
goto Cleanup;
}
@@ -350,7 +350,7 @@ InitializeTcgCommon (
Status = gMmst->MmRegisterProtocolNotify (&gEfiMmReadyToLockProtocolGuid, TcgMmReadyToLock, &NotifyHandle);
ASSERT_EFI_ERROR (Status);
if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "[%a] Failed to register ready to lock notification - %r!\n", __FUNCTION__, Status));
+ DEBUG ((DEBUG_ERROR, "[%a] Failed to register ready to lock notification - %r!\n", __func__, Status));
goto Cleanup;
}