public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Rebecca Cran" <rebecca@bsdio.com>
To: devel@edk2.groups.io, Liming Gao <gaoliming@byosoft.com.cn>,
	Michael D Kinney <michael.d.kinney@intel.com>,
	Guomin Jiang <guomin.jiang@intel.com>,
	Wei6 Xu <wei6.xu@intel.com>, Guo Dong <guo.dong@intel.com>,
	Ray Ni <ray.ni@intel.com>, Sean Rhodes <sean@starlabs.systems>,
	James Lu <james.lu@intel.com>, Gua Guo <gua.guo@intel.com>,
	Andrew Fish <afish@apple.com>, Hao A Wu <hao.a.wu@intel.com>,
	Maciej Rabeda <maciej.rabeda@linux.intel.com>,
	Siyuan Fu <siyuan.fu@intel.com>,
	Jiewen Yao <jiewen.yao@intel.com>,
	Jian J Wang <jian.j.wang@intel.com>,
	Xiaoyu Lu <xiaoyu1.lu@intel.com>,
	Ard Biesheuvel <ardb+tianocore@kernel.org>,
	Sami Mujawar <sami.mujawar@arm.com>,
	Supreeth Venkatesh <supreeth.venkatesh@arm.com>,
	Michael Kubacki <mikuback@linux.microsoft.com>,
	Nate DeSimone <nathaniel.l.desimone@intel.com>,
	Sean Brogan <sean.brogan@microsoft.com>
Cc: Rebecca Cran <rebecca@bsdio.com>,
	Leif Lindholm <quic_llindhol@quicinc.com>,
	Abner Chang <abner.chang@amd.com>,
	Nickle Wang <nicklew@nvidia.com>,
	Igor Kulchytskyy <igork@ami.com>,
	Daniel Schaefer <git@danielschaefer.me>,
	Min Xu <min.m.xu@intel.com>,
	Jordan Justen <jordan.l.justen@intel.com>,
	Gerd Hoffmann <kraxel@redhat.com>,
	Peter Grehan <grehan@freebsd.org>,
	Erdem Aktas <erdemaktas@google.com>,
	James Bottomley <jejb@linux.ibm.com>,
	Tom Lendacky <thomas.lendacky@amd.com>,
	Michael Roth <michael.roth@amd.com>,
	Sunil V L <sunilvl@ventanamicro.com>,
	Andrei Warkentin <andrei.warkentin@intel.com>
Subject: [PATCH 06/18] SecurityPkg: Update code to be more C11 compliant by using __func__
Date: Thu,  6 Apr 2023 16:23:07 -0600	[thread overview]
Message-ID: <20230406222319.2281263-7-rebecca@bsdio.com> (raw)
In-Reply-To: <20230406222319.2281263-1-rebecca@bsdio.com>

__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.

Visual Studio versions before VS 2015 don't support __func__ and so
will fail to compile. A workaround is to define __func__ as
__FUNCTION__ :

  #define __func__ __FUNCTION__

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
---
 SecurityPkg/HddPassword/HddPasswordDxe.c                                                | 44 ++++++++++----------
 SecurityPkg/HddPassword/HddPasswordPei.c                                                | 10 ++---
 SecurityPkg/Library/AuthVariableLib/AuthService.c                                       |  4 +-
 SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLib/PeiDxeTpmPlatformHierarchyLib.c       |  6 +--
 SecurityPkg/Library/PlatformPKProtectionLibVarPolicy/PlatformPKProtectionLibVarPolicy.c |  2 +-
 SecurityPkg/Library/SecureBootVariableLib/SecureBootVariableLib.c                       | 38 ++++++++---------
 SecurityPkg/Library/SecureBootVariableLib/UnitTest/SecureBootVariableLibUnitTest.c      |  4 +-
 SecurityPkg/Library/SecureBootVariableProvisionLib/SecureBootVariableProvisionLib.c     |  2 +-
 SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c                                          | 24 +++++------
 SecurityPkg/Tcg/Opal/OpalPassword/OpalHii.c                                             |  8 ++--
 SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordPei.c                                     | 10 ++---
 SecurityPkg/Tcg/Tcg2Acpi/Tcg2Acpi.c                                                     | 12 +++---
 SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c                                                       | 10 ++---
 SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c                                                       | 22 +++++-----
 SecurityPkg/Tcg/TdTcg2Dxe/TdTcg2Dxe.c                                                   |  6 +--
 SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c            |  2 +-
 SecurityPkg/VariableAuthenticated/SecureBootDefaultKeysDxe/SecureBootDefaultKeysDxe.c   | 14 +++----
 17 files changed, 109 insertions(+), 109 deletions(-)

diff --git a/SecurityPkg/HddPassword/HddPasswordDxe.c b/SecurityPkg/HddPassword/HddPasswordDxe.c
index a1a63b67a494..55dfb25886fc 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 a1c881599fa0..c56c00c685ac 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 452ed491eaac..d81c581d7885 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 b8838766bc45..cdb5248aff74 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 a2649242246f..ac18fcd7026f 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 abca249c6504..24599c7a0ba3 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 a23135dfb016..bff288295b00 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 bed1fe86205d..d6046c85d247 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 f127757ad9f0..e2e77cbc247a 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 c4f96bee8a3e..8035f44ebebb 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 c998b50be5e8..0fb6b1bf41d5 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 e8822cbeb015..76123fc51a53 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 26bb5282a58b..1caaa4e319bc 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 498fb626bd9c..c47c582cc8d2 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 b34da724ac42..6ca29f5de0df 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 4299a6b5e56d..0e31502b1bfc 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 0abde52a05ae..2f6f3e6796bf 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;
   }
 
-- 
2.34.1


  parent reply	other threads:[~2023-04-06 22:23 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-06 22:23 [PATCH 00/18] Replace pre-standard macro __FUNCTION__ with C99 __func__ throughout edk2 Rebecca Cran
2023-04-06 22:23 ` [PATCH 01/18] ArmPkg: Update code to be more C11 compliant by using __func__ Rebecca Cran
2023-04-07 20:18   ` [edk2-devel] " Michael D Kinney
2023-04-06 22:23 ` [PATCH 02/18] ArmVirtPkg: " Rebecca Cran
2023-04-06 22:23 ` [PATCH 03/18] UefiCpuPkg: " Rebecca Cran
2023-04-07  3:09   ` Ni, Ray
2023-04-07 11:24   ` Sunil V L
2023-04-06 22:23 ` [PATCH 04/18] OvmfPkg: " Rebecca Cran
2023-04-07 11:19   ` Sunil V L
2023-04-06 22:23 ` [PATCH 05/18] MdeModulePkg: " Rebecca Cran
2023-04-06 22:23 ` Rebecca Cran [this message]
2023-04-06 22:23 ` [PATCH 07/18] EmbeddedPkg: " Rebecca Cran
2023-04-07  8:25   ` Chang, Abner
2023-04-06 22:23 ` [PATCH 08/18] RedfishPkg: " Rebecca Cran
2023-04-07  5:39   ` Nickle Wang
2023-04-06 22:23 ` [PATCH 09/18] ArmPlatformPkg: " Rebecca Cran
2023-04-06 22:23 ` [PATCH 10/18] UnitTestFrameworkPkg: Update " Rebecca Cran
2023-04-06 22:23 ` [PATCH 11/18] PrmPkg: Update code " Rebecca Cran
2023-04-06 22:23 ` [PATCH 12/18] StandaloneMmPkg: " Rebecca Cran
2023-04-06 22:23 ` [PATCH 13/18] CryptoPkg: " Rebecca Cran
2023-04-06 22:23 ` [PATCH 14/18] NetworkPkg: " Rebecca Cran
2023-04-06 22:23 ` [PATCH 15/18] SourceLevelDebugPkg: " Rebecca Cran
2023-04-07  3:08   ` Ni, Ray
2023-04-06 22:23 ` [PATCH 16/18] EmulatorPkg: " Rebecca Cran
2023-04-07  3:08   ` Ni, Ray
2023-04-07  8:23   ` Chang, Abner
2023-04-06 22:23 ` [PATCH 17/18] UefiPayloadPkg: " Rebecca Cran
2023-04-07  5:57   ` Guo, Gua
2023-04-07  7:55   ` Lu, James
2023-04-06 22:23 ` [PATCH 18/18] FmpDevicePkg: " Rebecca Cran
2023-04-10  1:05   ` Xu, Wei6
2023-04-07 10:09 ` [edk2-devel] [PATCH 00/18] Replace pre-standard macro __FUNCTION__ with C99 __func__ throughout edk2 Ard Biesheuvel
2023-04-10 14:21 ` Rebecca Cran
2023-04-11  9:15 ` Gerd Hoffmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230406222319.2281263-7-rebecca@bsdio.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox