summaryrefslogtreecommitdiffstats
path: root/SecurityPkg
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
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')
-rw-r--r--SecurityPkg/HddPassword/HddPasswordDxe.c44
-rw-r--r--SecurityPkg/HddPassword/HddPasswordPei.c10
-rw-r--r--SecurityPkg/Library/AuthVariableLib/AuthService.c4
-rw-r--r--SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLib/PeiDxeTpmPlatformHierarchyLib.c6
-rw-r--r--SecurityPkg/Library/PlatformPKProtectionLibVarPolicy/PlatformPKProtectionLibVarPolicy.c2
-rw-r--r--SecurityPkg/Library/SecureBootVariableLib/SecureBootVariableLib.c38
-rw-r--r--SecurityPkg/Library/SecureBootVariableLib/UnitTest/SecureBootVariableLibUnitTest.c4
-rw-r--r--SecurityPkg/Library/SecureBootVariableProvisionLib/SecureBootVariableProvisionLib.c2
-rw-r--r--SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c24
-rw-r--r--SecurityPkg/Tcg/Opal/OpalPassword/OpalHii.c8
-rw-r--r--SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordPei.c10
-rw-r--r--SecurityPkg/Tcg/Tcg2Acpi/Tcg2Acpi.c12
-rw-r--r--SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c10
-rw-r--r--SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c22
-rw-r--r--SecurityPkg/Tcg/TdTcg2Dxe/TdTcg2Dxe.c6
-rw-r--r--SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c2
-rw-r--r--SecurityPkg/VariableAuthenticated/SecureBootDefaultKeysDxe/SecureBootDefaultKeysDxe.c14
17 files changed, 109 insertions, 109 deletions
diff --git a/SecurityPkg/HddPassword/HddPasswordDxe.c b/SecurityPkg/HddPassword/HddPasswordDxe.c
index a1a63b67a4..55dfb25886 100644
--- a/SecurityPkg/HddPassword/HddPasswordDxe.c
+++ b/SecurityPkg/HddPassword/HddPasswordDxe.c
@@ -314,7 +314,7 @@ FreezeLockDevice (
FreeAlignedPages (Asb, EFI_SIZE_TO_PAGES (sizeof (EFI_ATA_STATUS_BLOCK)));
- DEBUG ((DEBUG_INFO, "%a() - %r\n", __FUNCTION__, Status));
+ DEBUG ((DEBUG_INFO, "%a() - %r\n", __func__, Status));
return Status;
}
@@ -449,7 +449,7 @@ HddPasswordEndOfDxeEventNotify (
EFI_STATUS Status;
ATA_IDENTIFY_DATA IdentifyData;
- DEBUG ((DEBUG_INFO, "%a() - enter\n", __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a() - enter\n", __func__));
mHddPasswordEndOfDxe = TRUE;
@@ -503,7 +503,7 @@ HddPasswordEndOfDxeEventNotify (
}
}
- DEBUG ((DEBUG_INFO, "%a() - exit\n", __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a() - exit\n", __func__));
gBS->CloseEvent (Event);
}
@@ -620,7 +620,7 @@ SaveHddPasswordVariable (
UINT8 HashData[SHA256_DIGEST_SIZE];
UINT8 SaltData[PASSWORD_SALT_SIZE];
- DEBUG ((DEBUG_INFO, "%a() - enter\n", __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a() - enter\n", __func__));
Delete = FALSE;
if (!PasswordIsFullZero (Password)) {
@@ -765,7 +765,7 @@ SaveHddPasswordVariable (
FreePool (Variable);
}
- DEBUG ((DEBUG_INFO, "%a() - exit\n", __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a() - exit\n", __func__));
}
/**
@@ -791,7 +791,7 @@ GetSavedHddPasswordVariable (
UINTN VariableSize;
BOOLEAN Found;
- DEBUG ((DEBUG_INFO, "%a() - enter\n", __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a() - enter\n", __func__));
Variable = NULL;
VariableSize = 0;
@@ -835,7 +835,7 @@ GetSavedHddPasswordVariable (
DEBUG ((DEBUG_INFO, "The variable node for the HDD password device is not found\n"));
}
- DEBUG ((DEBUG_INFO, "%a() - exit\n", __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a() - exit\n", __func__));
return Found;
}
@@ -864,7 +864,7 @@ ValidateHddPassword (
BOOLEAN HashOk;
UINT8 HashData[SHA256_DIGEST_SIZE];
- DEBUG ((DEBUG_INFO, "%a() - enter\n", __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a() - enter\n", __func__));
if (!GetSavedHddPasswordVariable (ConfigFormEntry, &HddPasswordVariable)) {
DEBUG ((DEBUG_INFO, "GetSavedHddPasswordVariable failed\n"));
@@ -884,7 +884,7 @@ ValidateHddPassword (
Status = EFI_SUCCESS;
}
- DEBUG ((DEBUG_INFO, "%a() - exit (%r)\n", __FUNCTION__, Status));
+ DEBUG ((DEBUG_INFO, "%a() - exit (%r)\n", __func__, Status));
return Status;
}
@@ -982,7 +982,7 @@ UnlockHddPassword (
ZeroMem (Buffer, sizeof (Buffer));
- DEBUG ((DEBUG_INFO, "%a() - %r\n", __FUNCTION__, Status));
+ DEBUG ((DEBUG_INFO, "%a() - %r\n", __func__, Status));
return Status;
}
@@ -1080,7 +1080,7 @@ DisableHddPassword (
ZeroMem (Buffer, sizeof (Buffer));
- DEBUG ((DEBUG_INFO, "%a() - %r\n", __FUNCTION__, Status));
+ DEBUG ((DEBUG_INFO, "%a() - %r\n", __func__, Status));
return Status;
}
@@ -1185,7 +1185,7 @@ SetHddPassword (
ZeroMem (Buffer, sizeof (Buffer));
- DEBUG ((DEBUG_INFO, "%a() - %r\n", __FUNCTION__, Status));
+ DEBUG ((DEBUG_INFO, "%a() - %r\n", __func__, Status));
return Status;
}
@@ -1357,7 +1357,7 @@ HddPasswordRequestPassword (
RetryCount = 0;
- DEBUG ((DEBUG_INFO, "%a()\n", __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a()\n", __func__));
UnicodeSPrint (PopUpString, sizeof (PopUpString), L"Unlock: %s", ConfigFormEntry->HddString);
@@ -1541,7 +1541,7 @@ ProcessHddPasswordRequestSetUserPwd (
RetryCount = 0;
- DEBUG ((DEBUG_INFO, "%a()\n", __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a()\n", __func__));
if (ConfigFormEntry->IfrData.SecurityStatus.Frozen) {
DEBUG ((DEBUG_INFO, "%s is frozen, do nothing\n", ConfigFormEntry->HddString));
@@ -1685,7 +1685,7 @@ ProcessHddPasswordRequestSetMasterPwd (
RetryCount = 0;
- DEBUG ((DEBUG_INFO, "%a()\n", __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a()\n", __func__));
if (ConfigFormEntry->IfrData.SecurityStatus.Frozen) {
DEBUG ((DEBUG_INFO, "%s is frozen, do nothing\n", ConfigFormEntry->HddString));
@@ -1812,7 +1812,7 @@ ProcessHddPasswordRequest (
HDD_PASSWORD_REQUEST_VARIABLE *Variable;
UINTN VariableSize;
- DEBUG ((DEBUG_INFO, "%a() - enter\n", __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a() - enter\n", __func__));
if (mHddPasswordRequestVariable == NULL) {
Status = GetVariable2 (
@@ -1873,7 +1873,7 @@ ProcessHddPasswordRequest (
TempVariable += 1;
}
- DEBUG ((DEBUG_INFO, "%a() - exit\n", __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a() - exit\n", __func__));
}
/**
@@ -1892,7 +1892,7 @@ GetSavedHddPasswordRequest (
HDD_PASSWORD_REQUEST_VARIABLE *Variable;
UINTN VariableSize;
- DEBUG ((DEBUG_INFO, "%a() - enter\n", __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a() - enter\n", __func__));
Variable = NULL;
VariableSize = 0;
@@ -1934,7 +1934,7 @@ GetSavedHddPasswordRequest (
FreePool (Variable);
- DEBUG ((DEBUG_INFO, "%a() - exit\n", __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a() - exit\n", __func__));
}
/**
@@ -1956,7 +1956,7 @@ SaveHddPasswordRequest (
HDD_PASSWORD_REQUEST_VARIABLE *NewVariable;
UINTN NewVariableSize;
- DEBUG ((DEBUG_INFO, "%a() - enter\n", __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a() - enter\n", __func__));
DEBUG ((
DEBUG_INFO,
@@ -2047,7 +2047,7 @@ SaveHddPasswordRequest (
FreePool (Variable);
}
- DEBUG ((DEBUG_INFO, "%a() - exit\n", __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a() - exit\n", __func__));
}
/**
@@ -2865,7 +2865,7 @@ HddPasswordDxeInit (
HDD_PASSWORD_VARIABLE_NAME,
&mHddPasswordVendorGuid
);
- DEBUG ((DEBUG_INFO, "%a(): Lock %s variable (%r)\n", __FUNCTION__, HDD_PASSWORD_VARIABLE_NAME, Status));
+ DEBUG ((DEBUG_INFO, "%a(): Lock %s variable (%r)\n", __func__, HDD_PASSWORD_VARIABLE_NAME, Status));
ASSERT_EFI_ERROR (Status);
}
diff --git a/SecurityPkg/HddPassword/HddPasswordPei.c b/SecurityPkg/HddPassword/HddPasswordPei.c
index a1c881599f..c56c00c685 100644
--- a/SecurityPkg/HddPassword/HddPasswordPei.c
+++ b/SecurityPkg/HddPassword/HddPasswordPei.c
@@ -103,7 +103,7 @@ UnlockDevice (
ZeroMem (Buffer, sizeof (Buffer));
- DEBUG ((DEBUG_INFO, "%a() - %r\n", __FUNCTION__, Status));
+ DEBUG ((DEBUG_INFO, "%a() - %r\n", __func__, Status));
return Status;
}
@@ -186,7 +186,7 @@ FreezeLockDevice (
FreeAlignedPages (Asb, EFI_SIZE_TO_PAGES (sizeof (EFI_ATA_STATUS_BLOCK)));
- DEBUG ((DEBUG_INFO, "%a() - %r\n", __FUNCTION__, Status));
+ DEBUG ((DEBUG_INFO, "%a() - %r\n", __func__, Status));
return Status;
}
@@ -321,11 +321,11 @@ HddPasswordAtaPassThruNotify (
IN VOID *Ppi
)
{
- DEBUG ((DEBUG_INFO, "%a() - enter at S3 resume\n", __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a() - enter at S3 resume\n", __func__));
UnlockHddPassword ((EDKII_PEI_ATA_PASS_THRU_PPI *)Ppi);
- DEBUG ((DEBUG_INFO, "%a() - exit at S3 resume\n", __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a() - exit at S3 resume\n", __func__));
return EFI_SUCCESS;
}
@@ -360,7 +360,7 @@ HddPasswordPeiInit (
return EFI_UNSUPPORTED;
}
- DEBUG ((DEBUG_INFO, "%a: Enters in S3 path.\n", __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a: Enters in S3 path.\n", __func__));
Status = PeiServicesNotifyPpi (&mHddPasswordAtaPassThruPpiNotifyDesc);
ASSERT_EFI_ERROR (Status);
diff --git a/SecurityPkg/Library/AuthVariableLib/AuthService.c b/SecurityPkg/Library/AuthVariableLib/AuthService.c
index 452ed491ea..d81c581d78 100644
--- a/SecurityPkg/Library/AuthVariableLib/AuthService.c
+++ b/SecurityPkg/Library/AuthVariableLib/AuthService.c
@@ -1126,7 +1126,7 @@ CalculatePrivAuthVarSignChainSHA256Digest (
//
Status = X509GetCommonName (SignerCert, SignerCertSize, CertCommonName, &CertCommonNameSize);
if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_INFO, "%a Get SignerCert CommonName failed with status %x\n", __FUNCTION__, Status));
+ DEBUG ((DEBUG_INFO, "%a Get SignerCert CommonName failed with status %x\n", __func__, Status));
return EFI_ABORTED;
}
@@ -1134,7 +1134,7 @@ CalculatePrivAuthVarSignChainSHA256Digest (
// Get TopLevelCert tbsCertificate
//
if (!X509GetTBSCert (TopLevelCert, TopLevelCertSize, &TbsCert, &TbsCertSize)) {
- DEBUG ((DEBUG_INFO, "%a Get Top-level Cert tbsCertificate failed!\n", __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a Get Top-level Cert tbsCertificate failed!\n", __func__));
return EFI_ABORTED;
}
diff --git a/SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLib/PeiDxeTpmPlatformHierarchyLib.c b/SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLib/PeiDxeTpmPlatformHierarchyLib.c
index b8838766bc..cdb5248aff 100644
--- a/SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLib/PeiDxeTpmPlatformHierarchyLib.c
+++ b/SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLib/PeiDxeTpmPlatformHierarchyLib.c
@@ -205,7 +205,7 @@ DisableTpmPlatformHierarchy (
// Make sure that we have use of the TPM.
Status = Tpm2RequestUseTpm ();
if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "%a:%a() - Tpm2RequestUseTpm Failed! %r\n", gEfiCallerBaseName, __FUNCTION__, Status));
+ DEBUG ((DEBUG_ERROR, "%a:%a() - Tpm2RequestUseTpm Failed! %r\n", gEfiCallerBaseName, __func__, Status));
ASSERT_EFI_ERROR (Status);
return Status;
}
@@ -224,9 +224,9 @@ DisableTpmPlatformHierarchy (
TPM_RH_PLATFORM, // Hierarchy
NO // State
);
- DEBUG ((DEBUG_VERBOSE, "%a:%a() - Disable PH = %r\n", gEfiCallerBaseName, __FUNCTION__, Status));
+ DEBUG ((DEBUG_VERBOSE, "%a:%a() - Disable PH = %r\n", gEfiCallerBaseName, __func__, Status));
if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "%a:%a() - Disable PH Failed! %r\n", gEfiCallerBaseName, __FUNCTION__, Status));
+ DEBUG ((DEBUG_ERROR, "%a:%a() - Disable PH Failed! %r\n", gEfiCallerBaseName, __func__, Status));
ASSERT_EFI_ERROR (Status);
}
diff --git a/SecurityPkg/Library/PlatformPKProtectionLibVarPolicy/PlatformPKProtectionLibVarPolicy.c b/SecurityPkg/Library/PlatformPKProtectionLibVarPolicy/PlatformPKProtectionLibVarPolicy.c
index a264924224..ac18fcd702 100644
--- a/SecurityPkg/Library/PlatformPKProtectionLibVarPolicy/PlatformPKProtectionLibVarPolicy.c
+++ b/SecurityPkg/Library/PlatformPKProtectionLibVarPolicy/PlatformPKProtectionLibVarPolicy.c
@@ -33,7 +33,7 @@ DisablePKProtection (
EFI_STATUS Status;
EDKII_VARIABLE_POLICY_PROTOCOL *VariablePolicy;
- DEBUG ((DEBUG_INFO, "%a() Entry...\n", __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a() Entry...\n", __func__));
// IMPORTANT NOTE: This operation is sticky and leaves variable protections disabled.
// The system *MUST* be reset after performing this operation.
diff --git a/SecurityPkg/Library/SecureBootVariableLib/SecureBootVariableLib.c b/SecurityPkg/Library/SecureBootVariableLib/SecureBootVariableLib.c
index abca249c65..24599c7a0b 100644
--- a/SecurityPkg/Library/SecureBootVariableLib/SecureBootVariableLib.c
+++ b/SecurityPkg/Library/SecureBootVariableLib/SecureBootVariableLib.c
@@ -276,7 +276,7 @@ CreateTimeBasedPayload (
UINTN DescriptorSize;
if ((Data == NULL) || (DataSize == NULL) || (Time == NULL)) {
- DEBUG ((DEBUG_ERROR, "%a(), invalid arg\n", __FUNCTION__));
+ DEBUG ((DEBUG_ERROR, "%a(), invalid arg\n", __func__));
return EFI_INVALID_PARAMETER;
}
@@ -292,7 +292,7 @@ CreateTimeBasedPayload (
DescriptorSize = OFFSET_OF (EFI_VARIABLE_AUTHENTICATION_2, AuthInfo) + OFFSET_OF (WIN_CERTIFICATE_UEFI_GUID, CertData);
NewData = (UINT8 *)AllocateZeroPool (DescriptorSize + PayloadSize);
if (NewData == NULL) {
- DEBUG ((DEBUG_ERROR, "%a() Out of resources.\n", __FUNCTION__));
+ DEBUG ((DEBUG_ERROR, "%a() Out of resources.\n", __func__));
return EFI_OUT_OF_RESOURCES;
}
@@ -603,13 +603,13 @@ DeleteSecureBootVariables (
{
EFI_STATUS Status, TempStatus;
- DEBUG ((DEBUG_INFO, "%a - Attempting to delete the Secure Boot variables.\n", __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a - Attempting to delete the Secure Boot variables.\n", __func__));
//
// Step 1: Notify that a PK update is coming shortly...
Status = DisablePKProtection ();
if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "%a - Failed to signal PK update start! %r\n", __FUNCTION__, Status));
+ DEBUG ((DEBUG_ERROR, "%a - Failed to signal PK update start! %r\n", __func__, Status));
// Classify this as a PK deletion error.
Status = EFI_ABORTED;
}
@@ -619,7 +619,7 @@ DeleteSecureBootVariables (
// Let's try to nuke the PK, why not...
if (!EFI_ERROR (Status)) {
Status = DeletePlatformKey ();
- DEBUG ((DEBUG_INFO, "%a - PK Delete = %r\n", __FUNCTION__, Status));
+ DEBUG ((DEBUG_INFO, "%a - PK Delete = %r\n", __func__, Status));
// If the PK is not found, then our work here is done.
if (Status == EFI_NOT_FOUND) {
Status = EFI_SUCCESS;
@@ -646,25 +646,25 @@ DeleteSecureBootVariables (
// the variables anyway.
//
TempStatus = DeleteKEK ();
- DEBUG ((DEBUG_INFO, "%a - KEK Delete = %r\n", __FUNCTION__, TempStatus));
+ DEBUG ((DEBUG_INFO, "%a - KEK Delete = %r\n", __func__, TempStatus));
if (EFI_ERROR (TempStatus) && (TempStatus != EFI_NOT_FOUND)) {
Status = EFI_ACCESS_DENIED;
}
TempStatus = DeleteDb ();
- DEBUG ((DEBUG_INFO, "%a - db Delete = %r\n", __FUNCTION__, TempStatus));
+ DEBUG ((DEBUG_INFO, "%a - db Delete = %r\n", __func__, TempStatus));
if (EFI_ERROR (TempStatus) && (TempStatus != EFI_NOT_FOUND)) {
Status = EFI_ACCESS_DENIED;
}
TempStatus = DeleteDbx ();
- DEBUG ((DEBUG_INFO, "%a - dbx Delete = %r\n", __FUNCTION__, TempStatus));
+ DEBUG ((DEBUG_INFO, "%a - dbx Delete = %r\n", __func__, TempStatus));
if (EFI_ERROR (TempStatus) && (TempStatus != EFI_NOT_FOUND)) {
Status = EFI_ACCESS_DENIED;
}
TempStatus = DeleteDbt ();
- DEBUG ((DEBUG_INFO, "%a - dbt Delete = %r\n", __FUNCTION__, TempStatus));
+ DEBUG ((DEBUG_INFO, "%a - dbt Delete = %r\n", __func__, TempStatus));
if (EFI_ERROR (TempStatus) && (TempStatus != EFI_NOT_FOUND)) {
Status = EFI_ACCESS_DENIED;
}
@@ -752,7 +752,7 @@ EnrollFromInput (
DEBUG ((
DEBUG_ERROR,
"error: %a (\"%s\", %g): %r\n",
- __FUNCTION__,
+ __func__,
VariableName,
VendorGuid,
Status
@@ -795,21 +795,21 @@ SetSecureBootVariablesToDefault (
UINT8 *Data;
UINTN DataSize;
- DEBUG ((DEBUG_INFO, "%a() Entry\n", __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a() Entry\n", __func__));
if (SecureBootPayload == NULL) {
- DEBUG ((DEBUG_ERROR, "%a - Invalid SecureBoot payload is supplied!\n", __FUNCTION__));
+ DEBUG ((DEBUG_ERROR, "%a - Invalid SecureBoot payload is supplied!\n", __func__));
return EFI_INVALID_PARAMETER;
}
//
// Right off the bat, if SecureBoot is currently enabled, bail.
if (IsSecureBootEnabled ()) {
- DEBUG ((DEBUG_ERROR, "%a - Cannot set default keys while SecureBoot is enabled!\n", __FUNCTION__));
+ DEBUG ((DEBUG_ERROR, "%a - Cannot set default keys while SecureBoot is enabled!\n", __func__));
return EFI_ABORTED;
}
- DEBUG ((DEBUG_INFO, "%a - Setting up key %s!\n", __FUNCTION__, SecureBootPayload->SecureBootKeyName));
+ DEBUG ((DEBUG_INFO, "%a - Setting up key %s!\n", __func__, SecureBootPayload->SecureBootKeyName));
//
// Start running down the list, creating variables in our wake.
@@ -834,10 +834,10 @@ SetSecureBootVariablesToDefault (
Data
);
if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "%a - Failed to enroll DB %r!\n", __FUNCTION__, Status));
+ DEBUG ((DEBUG_ERROR, "%a - Failed to enroll DB %r!\n", __func__, Status));
}
} else {
- DEBUG ((DEBUG_ERROR, "%a - Failed to enroll DBX %r!\n", __FUNCTION__, Status));
+ DEBUG ((DEBUG_ERROR, "%a - Failed to enroll DBX %r!\n", __func__, Status));
}
// Keep it going. Keep it going. dbt if supplied...
@@ -851,7 +851,7 @@ SetSecureBootVariablesToDefault (
Data
);
if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "%a - Failed to enroll DBT %r!\n", __FUNCTION__, Status));
+ DEBUG ((DEBUG_ERROR, "%a - Failed to enroll DBT %r!\n", __func__, Status));
}
}
@@ -866,7 +866,7 @@ SetSecureBootVariablesToDefault (
Data
);
if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "%a - Failed to enroll KEK %r!\n", __FUNCTION__, Status));
+ DEBUG ((DEBUG_ERROR, "%a - Failed to enroll KEK %r!\n", __func__, Status));
}
}
@@ -889,7 +889,7 @@ SetSecureBootVariablesToDefault (
//
// Report PK creation errors.
if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "%a - Failed to update the PK! - %r\n", __FUNCTION__, Status));
+ DEBUG ((DEBUG_ERROR, "%a - Failed to update the PK! - %r\n", __func__, Status));
Status = EFI_SECURITY_VIOLATION;
}
}
diff --git a/SecurityPkg/Library/SecureBootVariableLib/UnitTest/SecureBootVariableLibUnitTest.c b/SecurityPkg/Library/SecureBootVariableLib/UnitTest/SecureBootVariableLibUnitTest.c
index e4cdc68bbb..fb9a0a2aba 100644
--- a/SecurityPkg/Library/SecureBootVariableLib/UnitTest/SecureBootVariableLibUnitTest.c
+++ b/SecurityPkg/Library/SecureBootVariableLib/UnitTest/SecureBootVariableLibUnitTest.c
@@ -82,7 +82,7 @@ MockSetVariable (
DEBUG ((
DEBUG_INFO,
"%a %s %g %x %x %p\n",
- __FUNCTION__,
+ __func__,
VariableName,
VendorGuid,
Attributes,
@@ -139,7 +139,7 @@ MockGetVariable (
DEBUG ((
DEBUG_INFO,
"%a %s %g %p %x %p\n",
- __FUNCTION__,
+ __func__,
VariableName,
VendorGuid,
Attributes,
diff --git a/SecurityPkg/Library/SecureBootVariableProvisionLib/SecureBootVariableProvisionLib.c b/SecurityPkg/Library/SecureBootVariableProvisionLib/SecureBootVariableProvisionLib.c
index bed1fe8620..d6046c85d2 100644
--- a/SecurityPkg/Library/SecureBootVariableProvisionLib/SecureBootVariableProvisionLib.c
+++ b/SecurityPkg/Library/SecureBootVariableProvisionLib/SecureBootVariableProvisionLib.c
@@ -81,7 +81,7 @@ SecureBootFetchData (
if (Status == EFI_SUCCESS) {
RsaPubKey = NULL;
if (RsaGetPublicKeyFromX509 (Buffer, Size, &RsaPubKey) == FALSE) {
- DEBUG ((DEBUG_ERROR, "%a: Invalid key format: %d\n", __FUNCTION__, KeyIndex));
+ DEBUG ((DEBUG_ERROR, "%a: Invalid key format: %d\n", __func__, KeyIndex));
if (EfiSig != NULL) {
FreePool (EfiSig);
}
diff --git a/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c b/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c
index f127757ad9..e2e77cbc24 100644
--- a/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c
+++ b/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c
@@ -491,7 +491,7 @@ OpalEndOfDxeEventNotify (
{
OPAL_DRIVER_DEVICE *TmpDev;
- DEBUG ((DEBUG_INFO, "%a() - enter\n", __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a() - enter\n", __func__));
mOpalEndOfDxe = TRUE;
@@ -529,7 +529,7 @@ OpalEndOfDxeEventNotify (
//
SendBlockSidCommand ();
- DEBUG ((DEBUG_INFO, "%a() - exit\n", __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a() - exit\n", __func__));
gBS->CloseEvent (Event);
}
@@ -888,7 +888,7 @@ OpalDriverRequestPassword (
return;
}
- DEBUG ((DEBUG_INFO, "%a()\n", __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a()\n", __func__));
PopUpString = OpalGetPopUpString (Dev, RequestString);
@@ -1074,7 +1074,7 @@ ProcessOpalRequestEnableFeature (
return;
}
- DEBUG ((DEBUG_INFO, "%a()\n", __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a()\n", __func__));
PopUpString = OpalGetPopUpString (Dev, RequestString);
@@ -1223,7 +1223,7 @@ ProcessOpalRequestDisableUser (
return;
}
- DEBUG ((DEBUG_INFO, "%a()\n", __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a()\n", __func__));
PopUpString = OpalGetPopUpString (Dev, RequestString);
@@ -1339,7 +1339,7 @@ ProcessOpalRequestPsidRevert (
return;
}
- DEBUG ((DEBUG_INFO, "%a()\n", __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a()\n", __func__));
PopUpString = OpalGetPopUpString (Dev, RequestString);
@@ -1478,7 +1478,7 @@ ProcessOpalRequestRevert (
return;
}
- DEBUG ((DEBUG_INFO, "%a()\n", __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a()\n", __func__));
PopUpString = OpalGetPopUpString (Dev, RequestString);
@@ -1646,7 +1646,7 @@ ProcessOpalRequestSecureErase (
return;
}
- DEBUG ((DEBUG_INFO, "%a()\n", __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a()\n", __func__));
PopUpString = OpalGetPopUpString (Dev, RequestString);
@@ -1784,7 +1784,7 @@ ProcessOpalRequestSetUserPwd (
return;
}
- DEBUG ((DEBUG_INFO, "%a()\n", __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a()\n", __func__));
PopUpString = OpalGetPopUpString (Dev, RequestString);
@@ -1990,7 +1990,7 @@ ProcessOpalRequestSetAdminPwd (
return;
}
- DEBUG ((DEBUG_INFO, "%a()\n", __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a()\n", __func__));
PopUpString = OpalGetPopUpString (Dev, RequestString);
@@ -2182,7 +2182,7 @@ ProcessOpalRequest (
UINTN DevicePathSize;
BOOLEAN KeepUserData;
- DEBUG ((DEBUG_INFO, "%a() - enter\n", __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a() - enter\n", __func__));
if (mOpalRequestVariable == NULL) {
Status = GetVariable2 (
@@ -2278,7 +2278,7 @@ ProcessOpalRequest (
TempVariable = (OPAL_REQUEST_VARIABLE *)((UINTN)TempVariable + TempVariable->Length);
}
- DEBUG ((DEBUG_INFO, "%a() - exit\n", __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a() - exit\n", __func__));
}
/**
diff --git a/SecurityPkg/Tcg/Opal/OpalPassword/OpalHii.c b/SecurityPkg/Tcg/Opal/OpalPassword/OpalHii.c
index c4f96bee8a..8035f44ebe 100644
--- a/SecurityPkg/Tcg/Opal/OpalPassword/OpalHii.c
+++ b/SecurityPkg/Tcg/Opal/OpalPassword/OpalHii.c
@@ -95,7 +95,7 @@ GetSavedOpalRequest (
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
UINTN DevicePathSize;
- DEBUG ((DEBUG_INFO, "%a() - enter\n", __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a() - enter\n", __func__));
Variable = NULL;
VariableSize = 0;
@@ -141,7 +141,7 @@ GetSavedOpalRequest (
FreePool (Variable);
- DEBUG ((DEBUG_INFO, "%a() - exit\n", __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a() - exit\n", __func__));
}
/**
@@ -169,7 +169,7 @@ SaveOpalRequest (
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
UINTN DevicePathSize;
- DEBUG ((DEBUG_INFO, "%a() - enter\n", __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a() - enter\n", __func__));
DEBUG ((
DEBUG_INFO,
@@ -264,7 +264,7 @@ SaveOpalRequest (
FreePool (Variable);
}
- DEBUG ((DEBUG_INFO, "%a() - exit\n", __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a() - exit\n", __func__));
}
/**
diff --git a/SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordPei.c b/SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordPei.c
index c998b50be5..0fb6b1bf41 100644
--- a/SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordPei.c
+++ b/SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordPei.c
@@ -280,7 +280,7 @@ UnlockOpalPassword (
DEBUG ((
DEBUG_INFO,
"%a() OpalUtilUpdateGlobalLockingRange() Result = 0x%x\n",
- __FUNCTION__,
+ __func__,
Result
));
}
@@ -302,7 +302,7 @@ UnlockOpalPassword (
DEBUG ((
DEBUG_INFO,
"%a() OpalBlockSid() Result = 0x%x\n",
- __FUNCTION__,
+ __func__,
Result
));
}
@@ -427,11 +427,11 @@ OpalPasswordStorageSecurityPpiNotify (
IN VOID *Ppi
)
{
- DEBUG ((DEBUG_INFO, "%a entered at S3 resume!\n", __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a entered at S3 resume!\n", __func__));
UnlockOpalPasswordDevices ((EDKII_PEI_STORAGE_SECURITY_CMD_PPI *)Ppi);
- DEBUG ((DEBUG_INFO, "%a exit at S3 resume!\n", __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a exit at S3 resume!\n", __func__));
return EFI_SUCCESS;
}
@@ -466,7 +466,7 @@ OpalPasswordPeiInit (
return EFI_UNSUPPORTED;
}
- DEBUG ((DEBUG_INFO, "%a: Enters in S3 path.\n", __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a: Enters in S3 path.\n", __func__));
Status = PeiServicesNotifyPpi (&mOpalPasswordStorageSecurityPpiNotifyDesc);
ASSERT_EFI_ERROR (Status);
diff --git a/SecurityPkg/Tcg/Tcg2Acpi/Tcg2Acpi.c b/SecurityPkg/Tcg/Tcg2Acpi/Tcg2Acpi.c
index e8822cbeb0..76123fc51a 100644
--- a/SecurityPkg/Tcg/Tcg2Acpi/Tcg2Acpi.c
+++ b/SecurityPkg/Tcg/Tcg2Acpi/Tcg2Acpi.c
@@ -188,14 +188,14 @@ ExchangeCommonBuffer (
// Step 0: Sanity check for input argument
if (TcgNvs == NULL) {
- DEBUG ((DEBUG_ERROR, "%a - Input argument is NULL!\n", __FUNCTION__));
+ DEBUG ((DEBUG_ERROR, "%a - Input argument is NULL!\n", __func__));
return EFI_INVALID_PARAMETER;
}
// Step 1: Grab the common buffer header
Status = EfiGetSystemConfigurationTable (&gEdkiiPiSmmCommunicationRegionTableGuid, (VOID **)&PiSmmCommunicationRegionTable);
if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "%a - Failed to locate SMM communciation common buffer - %r!\n", __FUNCTION__, Status));
+ DEBUG ((DEBUG_ERROR, "%a - Failed to locate SMM communciation common buffer - %r!\n", __func__, Status));
return Status;
}
@@ -215,7 +215,7 @@ ExchangeCommonBuffer (
if (Index >= PiSmmCommunicationRegionTable->NumberOfEntries) {
// Could not find one that meets our goal...
- DEBUG ((DEBUG_ERROR, "%a - Could not find a common buffer that is big enough for NVS!\n", __FUNCTION__));
+ DEBUG ((DEBUG_ERROR, "%a - Could not find a common buffer that is big enough for NVS!\n", __func__));
return EFI_OUT_OF_RESOURCES;
}
@@ -236,9 +236,9 @@ ExchangeCommonBuffer (
Status = gBS->LocateProtocol (&gEfiMmCommunicationProtocolGuid, NULL, (VOID **)&MmCommunication);
if (!EFI_ERROR (Status)) {
Status = MmCommunication->Communicate (MmCommunication, CommHeader, &CommBufferSize);
- DEBUG ((DEBUG_INFO, "%a - Communicate() = %r\n", __FUNCTION__, Status));
+ DEBUG ((DEBUG_INFO, "%a - Communicate() = %r\n", __func__, Status));
} else {
- DEBUG ((DEBUG_ERROR, "%a - Failed to locate MmCommunication protocol - %r\n", __FUNCTION__, Status));
+ DEBUG ((DEBUG_ERROR, "%a - Failed to locate MmCommunication protocol - %r\n", __func__, Status));
return Status;
}
@@ -250,7 +250,7 @@ ExchangeCommonBuffer (
DEBUG ((
DEBUG_INFO,
"%a Communication returned software SMI value. PP: 0x%x; MC: 0x%x.\n",
- __FUNCTION__,
+ __func__,
TcgNvs->PhysicalPresence.SoftwareSmi,
TcgNvs->MemoryClear.SoftwareSmi
));
diff --git a/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c b/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c
index 26bb5282a5..1caaa4e319 100644
--- a/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c
+++ b/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c
@@ -312,10 +312,10 @@ SyncPcrAllocationsAndPcrMask (
NewTpmActivePcrBanks &= BiosHashAlgorithmBitmap;
DEBUG ((DEBUG_INFO, "NewTpmActivePcrBanks 0x%08x\n", NewTpmActivePcrBanks));
- DEBUG ((DEBUG_INFO, "%a - Reallocating PCR banks from 0x%X to 0x%X.\n", __FUNCTION__, TpmActivePcrBanks, NewTpmActivePcrBanks));
+ DEBUG ((DEBUG_INFO, "%a - Reallocating PCR banks from 0x%X to 0x%X.\n", __func__, TpmActivePcrBanks, NewTpmActivePcrBanks));
if (NewTpmActivePcrBanks == 0) {
- DEBUG ((DEBUG_ERROR, "%a - No viable PCRs active! Please set a less restrictive value for PcdTpm2HashMask!\n", __FUNCTION__));
+ DEBUG ((DEBUG_ERROR, "%a - No viable PCRs active! Please set a less restrictive value for PcdTpm2HashMask!\n", __func__));
ASSERT (FALSE);
} else {
DEBUG ((DEBUG_ERROR, "Tpm2PcrAllocateBanks (TpmHashAlgorithmBitmap: 0x%08x, NewTpmActivePcrBanks: 0x%08x)\n", TpmHashAlgorithmBitmap, NewTpmActivePcrBanks));
@@ -324,7 +324,7 @@ SyncPcrAllocationsAndPcrMask (
//
// We can't do much here, but we hope that this doesn't happen.
//
- DEBUG ((DEBUG_ERROR, "%a - Failed to reallocate PCRs!\n", __FUNCTION__));
+ DEBUG ((DEBUG_ERROR, "%a - Failed to reallocate PCRs!\n", __func__));
ASSERT_EFI_ERROR (Status);
}
@@ -342,9 +342,9 @@ SyncPcrAllocationsAndPcrMask (
if ((Tpm2PcrMask & TpmHashAlgorithmBitmap) != Tpm2PcrMask) {
NewTpm2PcrMask = Tpm2PcrMask & TpmHashAlgorithmBitmap;
- DEBUG ((DEBUG_INFO, "%a - Updating PcdTpm2HashMask from 0x%X to 0x%X.\n", __FUNCTION__, Tpm2PcrMask, NewTpm2PcrMask));
+ DEBUG ((DEBUG_INFO, "%a - Updating PcdTpm2HashMask from 0x%X to 0x%X.\n", __func__, Tpm2PcrMask, NewTpm2PcrMask));
if (NewTpm2PcrMask == 0) {
- DEBUG ((DEBUG_ERROR, "%a - No viable PCRs supported! Please set a less restrictive value for PcdTpm2HashMask!\n", __FUNCTION__));
+ DEBUG ((DEBUG_ERROR, "%a - No viable PCRs supported! Please set a less restrictive value for PcdTpm2HashMask!\n", __func__));
ASSERT (FALSE);
}
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;
}
diff --git a/SecurityPkg/Tcg/TdTcg2Dxe/TdTcg2Dxe.c b/SecurityPkg/Tcg/TdTcg2Dxe/TdTcg2Dxe.c
index b34da724ac..6ca29f5de0 100644
--- a/SecurityPkg/Tcg/TdTcg2Dxe/TdTcg2Dxe.c
+++ b/SecurityPkg/Tcg/TdTcg2Dxe/TdTcg2Dxe.c
@@ -1353,12 +1353,12 @@ TdHashLogExtendEvent (
}
if (CcEvent->Header.MrIndex == CC_MR_INDEX_0_MRTD) {
- DEBUG ((DEBUG_ERROR, "%a: MRTD cannot be extended in TDVF.\n", __FUNCTION__));
+ DEBUG ((DEBUG_ERROR, "%a: MRTD cannot be extended in TDVF.\n", __func__));
return EFI_INVALID_PARAMETER;
}
if (CcEvent->Header.MrIndex >= CC_MR_INDEX_INVALID) {
- DEBUG ((DEBUG_ERROR, "%a: MrIndex is invalid. (%d)\n", __FUNCTION__, CcEvent->Header.MrIndex));
+ DEBUG ((DEBUG_ERROR, "%a: MrIndex is invalid. (%d)\n", __func__, CcEvent->Header.MrIndex));
return EFI_INVALID_PARAMETER;
}
@@ -2514,7 +2514,7 @@ DriverEntry (
//
// Cc measurement feature is crucial to a td-guest and it shall stop running immediately
// when it is failed to be installed.
- DEBUG ((DEBUG_ERROR, "%a: CcMeasurement protocol failed to be installed - %r\n", __FUNCTION__, Status));
+ DEBUG ((DEBUG_ERROR, "%a: CcMeasurement protocol failed to be installed - %r\n", __func__, Status));
CpuDeadLoop ();
}
diff --git a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c
index 4299a6b5e5..0e31502b1b 100644
--- a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c
+++ b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c
@@ -167,7 +167,7 @@ GetCurrentTime (
DEBUG ((
DEBUG_ERROR,
"%a(), GetTime() failed, status = '%r'\n",
- __FUNCTION__,
+ __func__,
Status
));
return Status;
diff --git a/SecurityPkg/VariableAuthenticated/SecureBootDefaultKeysDxe/SecureBootDefaultKeysDxe.c b/SecurityPkg/VariableAuthenticated/SecureBootDefaultKeysDxe/SecureBootDefaultKeysDxe.c
index 0abde52a05..2f6f3e6796 100644
--- a/SecurityPkg/VariableAuthenticated/SecureBootDefaultKeysDxe/SecureBootDefaultKeysDxe.c
+++ b/SecurityPkg/VariableAuthenticated/SecureBootDefaultKeysDxe/SecureBootDefaultKeysDxe.c
@@ -42,35 +42,35 @@ SecureBootDefaultKeysEntryPoint (
Status = SecureBootInitPKDefault ();
if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "%a: Cannot initialize PKDefault: %r\n", __FUNCTION__, Status));
+ DEBUG ((DEBUG_ERROR, "%a: Cannot initialize PKDefault: %r\n", __func__, Status));
return Status;
}
Status = SecureBootInitKEKDefault ();
if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "%a: Cannot initialize KEKDefault: %r\n", __FUNCTION__, Status));
+ DEBUG ((DEBUG_ERROR, "%a: Cannot initialize KEKDefault: %r\n", __func__, Status));
return Status;
}
Status = SecureBootInitDbDefault ();
if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "%a: Cannot initialize dbDefault: %r\n", __FUNCTION__, Status));
+ DEBUG ((DEBUG_ERROR, "%a: Cannot initialize dbDefault: %r\n", __func__, Status));
return Status;
}
Status = SecureBootInitDbtDefault ();
if (Status == EFI_NOT_FOUND) {
- DEBUG ((DEBUG_INFO, "%a: dbtDefault not initialized\n", __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a: dbtDefault not initialized\n", __func__));
} else if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "%a: Cannot initialize dbtDefault: %r\n", __FUNCTION__, Status));
+ DEBUG ((DEBUG_ERROR, "%a: Cannot initialize dbtDefault: %r\n", __func__, Status));
return Status;
}
Status = SecureBootInitDbxDefault ();
if (Status == EFI_NOT_FOUND) {
- DEBUG ((DEBUG_INFO, "%a: dbxDefault not initialized\n", __FUNCTION__));
+ DEBUG ((DEBUG_INFO, "%a: dbxDefault not initialized\n", __func__));
} else if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "%a: Cannot initialize dbxDefault: %r\n", __FUNCTION__, Status));
+ DEBUG ((DEBUG_ERROR, "%a: Cannot initialize dbxDefault: %r\n", __func__, Status));
return Status;
}