From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by mx.groups.io with SMTP id smtpd.web10.171992.1680819838785628340 for ; Thu, 06 Apr 2023 15:23:59 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@bsdio.com header.s=fm3 header.b=f2DZAUeE; spf=pass (domain: bsdio.com, ip: 66.111.4.29, mailfrom: rebecca@bsdio.com) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 1F7685C01E5; Thu, 6 Apr 2023 18:23:58 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Thu, 06 Apr 2023 18:23:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdio.com; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1680819838; x= 1680906238; bh=bqu3/VUCvzDn4YhyqeuWVluixzz4NEgL47chmViaFoE=; b=f 2DZAUeEA29mhsOh/HBCW2vkSWLxYrAaLzHjO6pKkonIW2sSfCNHueFLjeYY7p56J Ouh15h9e8aJw5uzqXMrgi4BdhkHTA7PmGOJyY8vXqozWT6NqOB0x3/3DqXozCQmv jaq9rvtSisDXxK/Ilm/PPnoooqqhf95HSNeiVAqzlyj/D3+fXd27CC/cfHbU1cdz CQMcgZZhysLhVB6rNixd1Uf+yO8gbymrHX8+WO0Hb9bC0cDEvwZ55oRui/ycqvVG aN1W/b+pk9/7nmyL79PEFxQsQlJySbiu0SyG/6TKxooF5B+oYUCeLTTJZzj0qh7Y Offl0p9cFyG6+wTkktmAw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1680819838; x= 1680906238; bh=bqu3/VUCvzDn4YhyqeuWVluixzz4NEgL47chmViaFoE=; b=B ULafouVETgaijCOonJuR7gqdhwvg64yw1u/AykmJDrHo72HyXKVBnZKMql5Eqzfk L1M1y0Chw7plWv09/Kh3TM6ftf//FYnm8FK98JyzFxMbRSZpHAQdtJS+9EV4Y34K tlQrhdDxUgEvj8x5uyEsUUIOSs9XViW9EljJFvjNR5jCdjnVTxRPwGJeVzY8fUJe sA7sjNDYQu5XU4s77WJD1PJvN2fYGegRCXI8R4x/R43yrT22ZXfEaeyxdlZgUZRa YGjz5ErD+jQKFFYUwwFgjTGVsCECvFpR6/qzzVcw0rno0SOmJaXfDOujr7ag9Sh8 HfnfkfqI4mVVhWOXk5OZg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdejgedgtdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomheptfgvsggv tggtrgcuvehrrghnuceorhgvsggvtggtrgessghsughiohdrtghomheqnecuggftrfgrth htvghrnhepgeffueeuledvgefgvddvgfetvdduhfefkedukeeikedtudekfeetteeifedv leefnecuvehluhhsthgvrhfuihiivgepvdenucfrrghrrghmpehmrghilhhfrhhomheprh gvsggvtggtrgessghsughiohdrtghomh X-ME-Proxy: Feedback-ID: i5b994698:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 6 Apr 2023 18:23:54 -0400 (EDT) From: "Rebecca Cran" To: devel@edk2.groups.io, Liming Gao , Michael D Kinney , Guomin Jiang , Wei6 Xu , Guo Dong , Ray Ni , Sean Rhodes , James Lu , Gua Guo , Andrew Fish , Hao A Wu , Maciej Rabeda , Siyuan Fu , Jiewen Yao , Jian J Wang , Xiaoyu Lu , Ard Biesheuvel , Sami Mujawar , Supreeth Venkatesh , Michael Kubacki , Nate DeSimone , Sean Brogan Cc: Rebecca Cran , Leif Lindholm , Abner Chang , Nickle Wang , Igor Kulchytskyy , Daniel Schaefer , Min Xu , Jordan Justen , Gerd Hoffmann , Peter Grehan , Erdem Aktas , James Bottomley , Tom Lendacky , Michael Roth , Sunil V L , Andrei Warkentin Subject: [PATCH 06/18] SecurityPkg: Update code to be more C11 compliant by using __func__ Date: Thu, 6 Apr 2023 16:23:07 -0600 Message-Id: <20230406222319.2281263-7-rebecca@bsdio.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230406222319.2281263-1-rebecca@bsdio.com> References: <20230406222319.2281263-1-rebecca@bsdio.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit __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 --- 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