From nobody Tue Feb 10 10:55:16 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+102636+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+102636+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1680819840; cv=none; d=zohomail.com; s=zohoarc; b=DjDJ7omAnrgJC7l0ASf8Tt6zZG/Rl3hiN4a0JH1Z9Zue6hSULo4HLD0g/MBWGHKv+AYtcmKALvJtVlPFtNfAmnHKAw7OYRtbsYR+06hDYEVSQFUfBfVQ5Mxa9dPCk9OvK+60KLXZpNJBAH39GU8kGaQB+2U6oLTaecv5VP7/Jc8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680819840; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=8wpFMsYuHNw5uX0CHjHyfE2y+8HQiIFphVAugdx+xzk=; b=GaB1FCl2VCThME4CVdBVeRdKN/+/Wg+slCbPP0wrOGLXBtERnu+Eymx1xrSFFBo+QMTb6u30u5VgORle5egk/rpID0d43/cjCp8QmBRB+pyvJrPaFmZDKbwxbZjRa9uAZ+O0YrwzJGBAsbbbiq8rxYCiWumasGCFwcoLnGnyMlA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+102636+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1680819840057210.63873775812579; Thu, 6 Apr 2023 15:24:00 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 6b45YY1788612xPuZUHoIfto; Thu, 06 Apr 2023 15:23:59 -0700 X-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 X-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) X-Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Thu, 06 Apr 2023 18:23:58 -0400 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 X-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: [edk2-devel] [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> In-Reply-To: <20230406222319.2281263-1-rebecca@bsdio.com> References: <20230406222319.2281263-1-rebecca@bsdio.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,rebecca@bsdio.com X-Gm-Message-State: qyI3lIu6xwmetTykthCUQ67Px1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1680819839; bh=aPUcx6dl5/giUcz120kSADP7hIlrZiBjZJfwuj+/wvo=; h=Cc:Date:From:Reply-To:Subject:To; b=NMU7j3vhD7Vvuw7R8VhTCFygZ/Nq+vI8RcisabrWW/kPqJzMTftjwghURMiMguEitxO Di4tikSfYDzOLaf5X9awoXvc1hSMwUn2WpDdzX5r63WUg7/Z9J4YDhB73neWaYcu7JL8s hG43WEiYu2FFTb+Y7p+ryvhWmuvf2+7W550= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1680819841234100001 Content-Type: text/plain; charset="utf-8" __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/PeiDxeTpmPlatformHierarc= hyLib.c | 6 +-- SecurityPkg/Library/PlatformPKProtectionLibVarPolicy/PlatformPKProtectionL= ibVarPolicy.c | 2 +- SecurityPkg/Library/SecureBootVariableLib/SecureBootVariableLib.c = | 38 ++++++++--------- SecurityPkg/Library/SecureBootVariableLib/UnitTest/SecureBootVariableLibUn= itTest.c | 4 +- SecurityPkg/Library/SecureBootVariableProvisionLib/SecureBootVariableProvi= sionLib.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/SecureBootDefau= ltKeysDxe.c | 14 +++---- 17 files changed, 109 insertions(+), 109 deletions(-) diff --git a/SecurityPkg/HddPassword/HddPasswordDxe.c b/SecurityPkg/HddPass= word/HddPasswordDxe.c index a1a63b67a494..55dfb25886fc 100644 --- a/SecurityPkg/HddPassword/HddPasswordDxe.c +++ b/SecurityPkg/HddPassword/HddPasswordDxe.c @@ -314,7 +314,7 @@ FreezeLockDevice ( =20 FreeAlignedPages (Asb, EFI_SIZE_TO_PAGES (sizeof (EFI_ATA_STATUS_BLOCK))= ); =20 - DEBUG ((DEBUG_INFO, "%a() - %r\n", __FUNCTION__, Status)); + DEBUG ((DEBUG_INFO, "%a() - %r\n", __func__, Status)); return Status; } =20 @@ -449,7 +449,7 @@ HddPasswordEndOfDxeEventNotify ( EFI_STATUS Status; ATA_IDENTIFY_DATA IdentifyData; =20 - DEBUG ((DEBUG_INFO, "%a() - enter\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a() - enter\n", __func__)); =20 mHddPasswordEndOfDxe =3D TRUE; =20 @@ -503,7 +503,7 @@ HddPasswordEndOfDxeEventNotify ( } } =20 - DEBUG ((DEBUG_INFO, "%a() - exit\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a() - exit\n", __func__)); =20 gBS->CloseEvent (Event); } @@ -620,7 +620,7 @@ SaveHddPasswordVariable ( UINT8 HashData[SHA256_DIGEST_SIZE]; UINT8 SaltData[PASSWORD_SALT_SIZE]; =20 - DEBUG ((DEBUG_INFO, "%a() - enter\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a() - enter\n", __func__)); =20 Delete =3D FALSE; if (!PasswordIsFullZero (Password)) { @@ -765,7 +765,7 @@ SaveHddPasswordVariable ( FreePool (Variable); } =20 - DEBUG ((DEBUG_INFO, "%a() - exit\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a() - exit\n", __func__)); } =20 /** @@ -791,7 +791,7 @@ GetSavedHddPasswordVariable ( UINTN VariableSize; BOOLEAN Found; =20 - DEBUG ((DEBUG_INFO, "%a() - enter\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a() - enter\n", __func__)); =20 Variable =3D NULL; VariableSize =3D 0; @@ -835,7 +835,7 @@ GetSavedHddPasswordVariable ( DEBUG ((DEBUG_INFO, "The variable node for the HDD password device is = not found\n")); } =20 - DEBUG ((DEBUG_INFO, "%a() - exit\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a() - exit\n", __func__)); =20 return Found; } @@ -864,7 +864,7 @@ ValidateHddPassword ( BOOLEAN HashOk; UINT8 HashData[SHA256_DIGEST_SIZE]; =20 - DEBUG ((DEBUG_INFO, "%a() - enter\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a() - enter\n", __func__)); =20 if (!GetSavedHddPasswordVariable (ConfigFormEntry, &HddPasswordVariable)= ) { DEBUG ((DEBUG_INFO, "GetSavedHddPasswordVariable failed\n")); @@ -884,7 +884,7 @@ ValidateHddPassword ( Status =3D EFI_SUCCESS; } =20 - DEBUG ((DEBUG_INFO, "%a() - exit (%r)\n", __FUNCTION__, Status)); + DEBUG ((DEBUG_INFO, "%a() - exit (%r)\n", __func__, Status)); return Status; } =20 @@ -982,7 +982,7 @@ UnlockHddPassword ( =20 ZeroMem (Buffer, sizeof (Buffer)); =20 - DEBUG ((DEBUG_INFO, "%a() - %r\n", __FUNCTION__, Status)); + DEBUG ((DEBUG_INFO, "%a() - %r\n", __func__, Status)); return Status; } =20 @@ -1080,7 +1080,7 @@ DisableHddPassword ( =20 ZeroMem (Buffer, sizeof (Buffer)); =20 - DEBUG ((DEBUG_INFO, "%a() - %r\n", __FUNCTION__, Status)); + DEBUG ((DEBUG_INFO, "%a() - %r\n", __func__, Status)); return Status; } =20 @@ -1185,7 +1185,7 @@ SetHddPassword ( =20 ZeroMem (Buffer, sizeof (Buffer)); =20 - DEBUG ((DEBUG_INFO, "%a() - %r\n", __FUNCTION__, Status)); + DEBUG ((DEBUG_INFO, "%a() - %r\n", __func__, Status)); return Status; } =20 @@ -1357,7 +1357,7 @@ HddPasswordRequestPassword ( =20 RetryCount =3D 0; =20 - DEBUG ((DEBUG_INFO, "%a()\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a()\n", __func__)); =20 UnicodeSPrint (PopUpString, sizeof (PopUpString), L"Unlock: %s", ConfigF= ormEntry->HddString); =20 @@ -1541,7 +1541,7 @@ ProcessHddPasswordRequestSetUserPwd ( =20 RetryCount =3D 0; =20 - DEBUG ((DEBUG_INFO, "%a()\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a()\n", __func__)); =20 if (ConfigFormEntry->IfrData.SecurityStatus.Frozen) { DEBUG ((DEBUG_INFO, "%s is frozen, do nothing\n", ConfigFormEntry->Hdd= String)); @@ -1685,7 +1685,7 @@ ProcessHddPasswordRequestSetMasterPwd ( =20 RetryCount =3D 0; =20 - DEBUG ((DEBUG_INFO, "%a()\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a()\n", __func__)); =20 if (ConfigFormEntry->IfrData.SecurityStatus.Frozen) { DEBUG ((DEBUG_INFO, "%s is frozen, do nothing\n", ConfigFormEntry->Hdd= String)); @@ -1812,7 +1812,7 @@ ProcessHddPasswordRequest ( HDD_PASSWORD_REQUEST_VARIABLE *Variable; UINTN VariableSize; =20 - DEBUG ((DEBUG_INFO, "%a() - enter\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a() - enter\n", __func__)); =20 if (mHddPasswordRequestVariable =3D=3D NULL) { Status =3D GetVariable2 ( @@ -1873,7 +1873,7 @@ ProcessHddPasswordRequest ( TempVariable +=3D 1; } =20 - DEBUG ((DEBUG_INFO, "%a() - exit\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a() - exit\n", __func__)); } =20 /** @@ -1892,7 +1892,7 @@ GetSavedHddPasswordRequest ( HDD_PASSWORD_REQUEST_VARIABLE *Variable; UINTN VariableSize; =20 - DEBUG ((DEBUG_INFO, "%a() - enter\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a() - enter\n", __func__)); =20 Variable =3D NULL; VariableSize =3D 0; @@ -1934,7 +1934,7 @@ GetSavedHddPasswordRequest ( =20 FreePool (Variable); =20 - DEBUG ((DEBUG_INFO, "%a() - exit\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a() - exit\n", __func__)); } =20 /** @@ -1956,7 +1956,7 @@ SaveHddPasswordRequest ( HDD_PASSWORD_REQUEST_VARIABLE *NewVariable; UINTN NewVariableSize; =20 - DEBUG ((DEBUG_INFO, "%a() - enter\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a() - enter\n", __func__)); =20 DEBUG (( DEBUG_INFO, @@ -2047,7 +2047,7 @@ SaveHddPasswordRequest ( FreePool (Variable); } =20 - DEBUG ((DEBUG_INFO, "%a() - exit\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a() - exit\n", __func__)); } =20 /** @@ -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_PAS= SWORD_VARIABLE_NAME, Status)); ASSERT_EFI_ERROR (Status); } =20 diff --git a/SecurityPkg/HddPassword/HddPasswordPei.c b/SecurityPkg/HddPass= word/HddPasswordPei.c index a1c881599fa0..c56c00c685ac 100644 --- a/SecurityPkg/HddPassword/HddPasswordPei.c +++ b/SecurityPkg/HddPassword/HddPasswordPei.c @@ -103,7 +103,7 @@ UnlockDevice ( =20 ZeroMem (Buffer, sizeof (Buffer)); =20 - DEBUG ((DEBUG_INFO, "%a() - %r\n", __FUNCTION__, Status)); + DEBUG ((DEBUG_INFO, "%a() - %r\n", __func__, Status)); return Status; } =20 @@ -186,7 +186,7 @@ FreezeLockDevice ( =20 FreeAlignedPages (Asb, EFI_SIZE_TO_PAGES (sizeof (EFI_ATA_STATUS_BLOCK))= ); =20 - DEBUG ((DEBUG_INFO, "%a() - %r\n", __FUNCTION__, Status)); + DEBUG ((DEBUG_INFO, "%a() - %r\n", __func__, Status)); return Status; } =20 @@ -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__)); =20 UnlockHddPassword ((EDKII_PEI_ATA_PASS_THRU_PPI *)Ppi); =20 - DEBUG ((DEBUG_INFO, "%a() - exit at S3 resume\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a() - exit at S3 resume\n", __func__)); =20 return EFI_SUCCESS; } @@ -360,7 +360,7 @@ HddPasswordPeiInit ( return EFI_UNSUPPORTED; } =20 - DEBUG ((DEBUG_INFO, "%a: Enters in S3 path.\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a: Enters in S3 path.\n", __func__)); =20 Status =3D PeiServicesNotifyPpi (&mHddPasswordAtaPassThruPpiNotifyDesc); ASSERT_EFI_ERROR (Status); diff --git a/SecurityPkg/Library/AuthVariableLib/AuthService.c b/SecurityPk= g/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 =3D 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; } =20 @@ -1134,7 +1134,7 @@ CalculatePrivAuthVarSignChainSHA256Digest ( // Get TopLevelCert tbsCertificate // if (!X509GetTBSCert (TopLevelCert, TopLevelCertSize, &TbsCert, &TbsCertS= ize)) { - 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; } =20 diff --git a/SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLib/PeiDxeTpmPla= tformHierarchyLib.c b/SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLib/Pei= DxeTpmPlatformHierarchyLib.c index b8838766bc45..cdb5248aff74 100644 --- a/SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLib/PeiDxeTpmPlatformHi= erarchyLib.c +++ b/SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLib/PeiDxeTpmPlatformHi= erarchyLib.c @@ -205,7 +205,7 @@ DisableTpmPlatformHierarchy ( // Make sure that we have use of the TPM. Status =3D Tpm2RequestUseTpm (); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a:%a() - Tpm2RequestUseTpm Failed! %r\n", gEfiC= allerBaseName, __FUNCTION__, Status)); + DEBUG ((DEBUG_ERROR, "%a:%a() - Tpm2RequestUseTpm Failed! %r\n", gEfiC= allerBaseName, __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 =3D %r\n", gEfiCallerBaseN= ame, __FUNCTION__, Status)); + DEBUG ((DEBUG_VERBOSE, "%a:%a() - Disable PH =3D %r\n", gEfiCallerBaseN= ame, __func__, Status)); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a:%a() - Disable PH Failed! %r\n", gEfiCallerB= aseName, __FUNCTION__, Status)); + DEBUG ((DEBUG_ERROR, "%a:%a() - Disable PH Failed! %r\n", gEfiCallerB= aseName, __func__, Status)); ASSERT_EFI_ERROR (Status); } =20 diff --git a/SecurityPkg/Library/PlatformPKProtectionLibVarPolicy/PlatformP= KProtectionLibVarPolicy.c b/SecurityPkg/Library/PlatformPKProtectionLibVarP= olicy/PlatformPKProtectionLibVarPolicy.c index a2649242246f..ac18fcd7026f 100644 --- a/SecurityPkg/Library/PlatformPKProtectionLibVarPolicy/PlatformPKProtec= tionLibVarPolicy.c +++ b/SecurityPkg/Library/PlatformPKProtectionLibVarPolicy/PlatformPKProtec= tionLibVarPolicy.c @@ -33,7 +33,7 @@ DisablePKProtection ( EFI_STATUS Status; EDKII_VARIABLE_POLICY_PROTOCOL *VariablePolicy; =20 - DEBUG ((DEBUG_INFO, "%a() Entry...\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a() Entry...\n", __func__)); =20 // IMPORTANT NOTE: This operation is sticky and leaves variable protecti= ons disabled. // The system *MUST* be reset after performing this ope= ration. diff --git a/SecurityPkg/Library/SecureBootVariableLib/SecureBootVariableLi= b.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; =20 if ((Data =3D=3D NULL) || (DataSize =3D=3D NULL) || (Time =3D=3D NULL)) { - DEBUG ((DEBUG_ERROR, "%a(), invalid arg\n", __FUNCTION__)); + DEBUG ((DEBUG_ERROR, "%a(), invalid arg\n", __func__)); return EFI_INVALID_PARAMETER; } =20 @@ -292,7 +292,7 @@ CreateTimeBasedPayload ( DescriptorSize =3D OFFSET_OF (EFI_VARIABLE_AUTHENTICATION_2, AuthInfo) += OFFSET_OF (WIN_CERTIFICATE_UEFI_GUID, CertData); NewData =3D (UINT8 *)AllocateZeroPool (DescriptorSize + PayloadSi= ze); if (NewData =3D=3D NULL) { - DEBUG ((DEBUG_ERROR, "%a() Out of resources.\n", __FUNCTION__)); + DEBUG ((DEBUG_ERROR, "%a() Out of resources.\n", __func__)); return EFI_OUT_OF_RESOURCES; } =20 @@ -603,13 +603,13 @@ DeleteSecureBootVariables ( { EFI_STATUS Status, TempStatus; =20 - 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__)); =20 // // Step 1: Notify that a PK update is coming shortly... Status =3D 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 =3D EFI_ABORTED; } @@ -619,7 +619,7 @@ DeleteSecureBootVariables ( // Let's try to nuke the PK, why not... if (!EFI_ERROR (Status)) { Status =3D DeletePlatformKey (); - DEBUG ((DEBUG_INFO, "%a - PK Delete =3D %r\n", __FUNCTION__, Status)); + DEBUG ((DEBUG_INFO, "%a - PK Delete =3D %r\n", __func__, Status)); // If the PK is not found, then our work here is done. if (Status =3D=3D EFI_NOT_FOUND) { Status =3D EFI_SUCCESS; @@ -646,25 +646,25 @@ DeleteSecureBootVariables ( // the variables anyway. // TempStatus =3D DeleteKEK (); - DEBUG ((DEBUG_INFO, "%a - KEK Delete =3D %r\n", __FUNCTION__, TempStat= us)); + DEBUG ((DEBUG_INFO, "%a - KEK Delete =3D %r\n", __func__, TempStatus)); if (EFI_ERROR (TempStatus) && (TempStatus !=3D EFI_NOT_FOUND)) { Status =3D EFI_ACCESS_DENIED; } =20 TempStatus =3D DeleteDb (); - DEBUG ((DEBUG_INFO, "%a - db Delete =3D %r\n", __FUNCTION__, TempStatu= s)); + DEBUG ((DEBUG_INFO, "%a - db Delete =3D %r\n", __func__, TempStatus)); if (EFI_ERROR (TempStatus) && (TempStatus !=3D EFI_NOT_FOUND)) { Status =3D EFI_ACCESS_DENIED; } =20 TempStatus =3D DeleteDbx (); - DEBUG ((DEBUG_INFO, "%a - dbx Delete =3D %r\n", __FUNCTION__, TempStat= us)); + DEBUG ((DEBUG_INFO, "%a - dbx Delete =3D %r\n", __func__, TempStatus)); if (EFI_ERROR (TempStatus) && (TempStatus !=3D EFI_NOT_FOUND)) { Status =3D EFI_ACCESS_DENIED; } =20 TempStatus =3D DeleteDbt (); - DEBUG ((DEBUG_INFO, "%a - dbt Delete =3D %r\n", __FUNCTION__, TempStat= us)); + DEBUG ((DEBUG_INFO, "%a - dbt Delete =3D %r\n", __func__, TempStatus)); if (EFI_ERROR (TempStatus) && (TempStatus !=3D EFI_NOT_FOUND)) { Status =3D 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; =20 - DEBUG ((DEBUG_INFO, "%a() Entry\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a() Entry\n", __func__)); =20 if (SecureBootPayload =3D=3D 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; } =20 // // 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; } =20 - DEBUG ((DEBUG_INFO, "%a - Setting up key %s!\n", __FUNCTION__, SecureBoo= tPayload->SecureBootKeyName)); + DEBUG ((DEBUG_INFO, "%a - Setting up key %s!\n", __func__, SecureBootPay= load->SecureBootKeyName)); =20 // // 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__, Sta= tus)); } } else { - DEBUG ((DEBUG_ERROR, "%a - Failed to enroll DBX %r!\n", __FUNCTION__, = Status)); + DEBUG ((DEBUG_ERROR, "%a - Failed to enroll DBX %r!\n", __func__, Stat= us)); } =20 // 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__, St= atus)); } } =20 @@ -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__, St= atus)); } } =20 @@ -889,7 +889,7 @@ SetSecureBootVariablesToDefault ( // // Report PK creation errors. if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a - Failed to update the PK! - %r\n", __FUNCT= ION__, Status)); + DEBUG ((DEBUG_ERROR, "%a - Failed to update the PK! - %r\n", __func_= _, Status)); Status =3D EFI_SECURITY_VIOLATION; } } diff --git a/SecurityPkg/Library/SecureBootVariableLib/UnitTest/SecureBootV= ariableLibUnitTest.c b/SecurityPkg/Library/SecureBootVariableLib/UnitTest/S= ecureBootVariableLibUnitTest.c index a23135dfb016..bff288295b00 100644 --- a/SecurityPkg/Library/SecureBootVariableLib/UnitTest/SecureBootVariable= LibUnitTest.c +++ b/SecurityPkg/Library/SecureBootVariableLib/UnitTest/SecureBootVariable= LibUnitTest.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/SecureBootV= ariableProvisionLib.c b/SecurityPkg/Library/SecureBootVariableProvisionLib/= SecureBootVariableProvisionLib.c index bed1fe86205d..d6046c85d247 100644 --- a/SecurityPkg/Library/SecureBootVariableProvisionLib/SecureBootVariable= ProvisionLib.c +++ b/SecurityPkg/Library/SecureBootVariableProvisionLib/SecureBootVariable= ProvisionLib.c @@ -81,7 +81,7 @@ SecureBootFetchData ( if (Status =3D=3D EFI_SUCCESS) { RsaPubKey =3D NULL; if (RsaGetPublicKeyFromX509 (Buffer, Size, &RsaPubKey) =3D=3D FALSE)= { - DEBUG ((DEBUG_ERROR, "%a: Invalid key format: %d\n", __FUNCTION__,= KeyIndex)); + DEBUG ((DEBUG_ERROR, "%a: Invalid key format: %d\n", __func__, Key= Index)); if (EfiSig !=3D NULL) { FreePool (EfiSig); } diff --git a/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c b/SecurityPkg/T= cg/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; =20 - DEBUG ((DEBUG_INFO, "%a() - enter\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a() - enter\n", __func__)); =20 mOpalEndOfDxe =3D TRUE; =20 @@ -529,7 +529,7 @@ OpalEndOfDxeEventNotify ( // SendBlockSidCommand (); =20 - DEBUG ((DEBUG_INFO, "%a() - exit\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a() - exit\n", __func__)); =20 gBS->CloseEvent (Event); } @@ -888,7 +888,7 @@ OpalDriverRequestPassword ( return; } =20 - DEBUG ((DEBUG_INFO, "%a()\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a()\n", __func__)); =20 PopUpString =3D OpalGetPopUpString (Dev, RequestString); =20 @@ -1074,7 +1074,7 @@ ProcessOpalRequestEnableFeature ( return; } =20 - DEBUG ((DEBUG_INFO, "%a()\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a()\n", __func__)); =20 PopUpString =3D OpalGetPopUpString (Dev, RequestString); =20 @@ -1223,7 +1223,7 @@ ProcessOpalRequestDisableUser ( return; } =20 - DEBUG ((DEBUG_INFO, "%a()\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a()\n", __func__)); =20 PopUpString =3D OpalGetPopUpString (Dev, RequestString); =20 @@ -1339,7 +1339,7 @@ ProcessOpalRequestPsidRevert ( return; } =20 - DEBUG ((DEBUG_INFO, "%a()\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a()\n", __func__)); =20 PopUpString =3D OpalGetPopUpString (Dev, RequestString); =20 @@ -1478,7 +1478,7 @@ ProcessOpalRequestRevert ( return; } =20 - DEBUG ((DEBUG_INFO, "%a()\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a()\n", __func__)); =20 PopUpString =3D OpalGetPopUpString (Dev, RequestString); =20 @@ -1646,7 +1646,7 @@ ProcessOpalRequestSecureErase ( return; } =20 - DEBUG ((DEBUG_INFO, "%a()\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a()\n", __func__)); =20 PopUpString =3D OpalGetPopUpString (Dev, RequestString); =20 @@ -1784,7 +1784,7 @@ ProcessOpalRequestSetUserPwd ( return; } =20 - DEBUG ((DEBUG_INFO, "%a()\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a()\n", __func__)); =20 PopUpString =3D OpalGetPopUpString (Dev, RequestString); =20 @@ -1990,7 +1990,7 @@ ProcessOpalRequestSetAdminPwd ( return; } =20 - DEBUG ((DEBUG_INFO, "%a()\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a()\n", __func__)); =20 PopUpString =3D OpalGetPopUpString (Dev, RequestString); =20 @@ -2182,7 +2182,7 @@ ProcessOpalRequest ( UINTN DevicePathSize; BOOLEAN KeepUserData; =20 - DEBUG ((DEBUG_INFO, "%a() - enter\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a() - enter\n", __func__)); =20 if (mOpalRequestVariable =3D=3D NULL) { Status =3D GetVariable2 ( @@ -2278,7 +2278,7 @@ ProcessOpalRequest ( TempVariable =3D (OPAL_REQUEST_VARIABLE *)((UINTN)TempVariable + Temp= Variable->Length); } =20 - DEBUG ((DEBUG_INFO, "%a() - exit\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a() - exit\n", __func__)); } =20 /** 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; =20 - DEBUG ((DEBUG_INFO, "%a() - enter\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a() - enter\n", __func__)); =20 Variable =3D NULL; VariableSize =3D 0; @@ -141,7 +141,7 @@ GetSavedOpalRequest ( =20 FreePool (Variable); =20 - DEBUG ((DEBUG_INFO, "%a() - exit\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a() - exit\n", __func__)); } =20 /** @@ -169,7 +169,7 @@ SaveOpalRequest ( EFI_DEVICE_PATH_PROTOCOL *DevicePath; UINTN DevicePathSize; =20 - DEBUG ((DEBUG_INFO, "%a() - enter\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a() - enter\n", __func__)); =20 DEBUG (( DEBUG_INFO, @@ -264,7 +264,7 @@ SaveOpalRequest ( FreePool (Variable); } =20 - DEBUG ((DEBUG_INFO, "%a() - exit\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a() - exit\n", __func__)); } =20 /** diff --git a/SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordPei.c b/Security= Pkg/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 =3D 0x%x\n", - __FUNCTION__, + __func__, Result )); } @@ -302,7 +302,7 @@ UnlockOpalPassword ( DEBUG (( DEBUG_INFO, "%a() OpalBlockSid() Result =3D 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__)); =20 UnlockOpalPasswordDevices ((EDKII_PEI_STORAGE_SECURITY_CMD_PPI *)Ppi); =20 - DEBUG ((DEBUG_INFO, "%a exit at S3 resume!\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a exit at S3 resume!\n", __func__)); =20 return EFI_SUCCESS; } @@ -466,7 +466,7 @@ OpalPasswordPeiInit ( return EFI_UNSUPPORTED; } =20 - DEBUG ((DEBUG_INFO, "%a: Enters in S3 path.\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a: Enters in S3 path.\n", __func__)); =20 Status =3D PeiServicesNotifyPpi (&mOpalPasswordStorageSecurityPpiNotifyD= esc); 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 ( =20 // Step 0: Sanity check for input argument if (TcgNvs =3D=3D 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; } =20 // Step 1: Grab the common buffer header Status =3D EfiGetSystemConfigurationTable (&gEdkiiPiSmmCommunicationRegi= onTableGuid, (VOID **)&PiSmmCommunicationRegionTable); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a - Failed to locate SMM communciation common b= uffer - %r!\n", __FUNCTION__, Status)); + DEBUG ((DEBUG_ERROR, "%a - Failed to locate SMM communciation common b= uffer - %r!\n", __func__, Status)); return Status; } =20 @@ -215,7 +215,7 @@ ExchangeCommonBuffer ( =20 if (Index >=3D 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; } =20 @@ -236,9 +236,9 @@ ExchangeCommonBuffer ( Status =3D gBS->LocateProtocol (&gEfiMmCommunicationProtocolGuid, NULL, = (VOID **)&MmCommunication); if (!EFI_ERROR (Status)) { Status =3D MmCommunication->Communicate (MmCommunication, CommHeader, = &CommBufferSize); - DEBUG ((DEBUG_INFO, "%a - Communicate() =3D %r\n", __FUNCTION__, Statu= s)); + DEBUG ((DEBUG_INFO, "%a - Communicate() =3D %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; } =20 @@ -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/Tc= g2Pei.c index 26bb5282a58b..1caaa4e319bc 100644 --- a/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c +++ b/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c @@ -312,10 +312,10 @@ SyncPcrAllocationsAndPcrMask ( NewTpmActivePcrBanks &=3D BiosHashAlgorithmBitmap; DEBUG ((DEBUG_INFO, "NewTpmActivePcrBanks 0x%08x\n", NewTpmActivePcrBa= nks)); =20 - 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)); =20 if (NewTpmActivePcrBanks =3D=3D 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, NewTpmAct= ivePcrBanks)); @@ -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", __FUNCTI= ON__)); + DEBUG ((DEBUG_ERROR, "%a - Failed to reallocate PCRs!\n", __func__= )); ASSERT_EFI_ERROR (Status); } =20 @@ -342,9 +342,9 @@ SyncPcrAllocationsAndPcrMask ( if ((Tpm2PcrMask & TpmHashAlgorithmBitmap) !=3D Tpm2PcrMask) { NewTpm2PcrMask =3D Tpm2PcrMask & TpmHashAlgorithmBitmap; =20 - 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 =3D=3D 0) { - DEBUG ((DEBUG_ERROR, "%a - No viable PCRs supported! Please set a le= ss restrictive value for PcdTpm2HashMask!\n", __FUNCTION__)); + DEBUG ((DEBUG_ERROR, "%a - No viable PCRs supported! Please set a le= ss restrictive value for PcdTpm2HashMask!\n", __func__)); ASSERT (FALSE); } =20 diff --git a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c b/SecurityPkg/Tcg/Tcg2Smm/Tc= g2Smm.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; =20 - DEBUG ((DEBUG_VERBOSE, "%a()\n", __FUNCTION__)); + DEBUG ((DEBUG_VERBOSE, "%a()\n", __func__)); =20 // // If input is invalid, stop processing this SMI @@ -69,12 +69,12 @@ TpmNvsCommunciate ( TempCommBufferSize =3D *CommBufferSize; =20 if (TempCommBufferSize !=3D 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; } =20 if (!IsBufferOutsideMmValid ((UINTN)CommBuffer, TempCommBufferSize)) { - DEBUG ((DEBUG_ERROR, "[%a] - MM Communication buffer in invalid locati= on!\n", __FUNCTION__)); + DEBUG ((DEBUG_ERROR, "[%a] - MM Communication buffer in invalid locati= on!\n", __func__)); return EFI_ACCESS_DENIED; } =20 @@ -85,14 +85,14 @@ TpmNvsCommunciate ( Status =3D EFI_SUCCESS; switch (CommParams->Function) { case TpmNvsMmExchangeInfo: - DEBUG ((DEBUG_VERBOSE, "[%a] - Function requested: MM_EXCHANGE_NVS_I= NFO\n", __FUNCTION__)); + DEBUG ((DEBUG_VERBOSE, "[%a] - Function requested: MM_EXCHANGE_NVS_I= NFO\n", __func__)); CommParams->RegisteredPpSwiValue =3D mPpSoftwareSmi; CommParams->RegisteredMcSwiValue =3D mMcSoftwareSmi; mTcgNvs =3D (TCG_NVS *)(UINTN)CommParams->T= argetAddress; break; =20 default: - DEBUG ((DEBUG_INFO, "[%a] - Unknown function %d!\n", __FUNCTION__, C= ommParams->Function)); + DEBUG ((DEBUG_INFO, "[%a] - Unknown function %d!\n", __func__, CommP= arams->Function)); Status =3D EFI_UNSUPPORTED; break; } @@ -301,7 +301,7 @@ InitializeTcgCommon ( Status =3D 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; } =20 @@ -311,7 +311,7 @@ InitializeTcgCommon ( Status =3D gMmst->MmLocateProtocol (&gEfiSmmSwDispatch2ProtocolGuid, NUL= L, (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; } =20 @@ -319,7 +319,7 @@ InitializeTcgCommon ( Status =3D SwDispatch->Register (SwDispatch, Physical= PresenceCallback, &SwContext, &PpSwHandle); ASSERT_EFI_ERROR (Status); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "[%a] Failed to register PP callback as SW MM han= dler - %r!\n", __FUNCTION__, Status)); + DEBUG ((DEBUG_ERROR, "[%a] Failed to register PP callback as SW MM han= dler - %r!\n", __func__, Status)); goto Cleanup; } =20 @@ -329,7 +329,7 @@ InitializeTcgCommon ( Status =3D SwDispatch->Register (SwDispatch, MemoryCl= earCallback, &SwContext, &McSwHandle); ASSERT_EFI_ERROR (Status); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "[%a] Failed to register MC callback as SW MM han= dler - %r!\n", __FUNCTION__, Status)); + DEBUG ((DEBUG_ERROR, "[%a] Failed to register MC callback as SW MM han= dler - %r!\n", __func__, Status)); goto Cleanup; } =20 @@ -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; } =20 @@ -350,7 +350,7 @@ InitializeTcgCommon ( Status =3D gMmst->MmRegisterProtocolNotify (&gEfiMmReadyToLockProtocolGu= id, TcgMmReadyToLock, &NotifyHandle); ASSERT_EFI_ERROR (Status); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "[%a] Failed to register ready to lock notificati= on - %r!\n", __FUNCTION__, Status)); + DEBUG ((DEBUG_ERROR, "[%a] Failed to register ready to lock notificati= on - %r!\n", __func__, Status)); goto Cleanup; } =20 diff --git a/SecurityPkg/Tcg/TdTcg2Dxe/TdTcg2Dxe.c b/SecurityPkg/Tcg/TdTcg2= Dxe/TdTcg2Dxe.c index b34da724ac42..6ca29f5de0df 100644 --- a/SecurityPkg/Tcg/TdTcg2Dxe/TdTcg2Dxe.c +++ b/SecurityPkg/Tcg/TdTcg2Dxe/TdTcg2Dxe.c @@ -1353,12 +1353,12 @@ TdHashLogExtendEvent ( } =20 if (CcEvent->Header.MrIndex =3D=3D CC_MR_INDEX_0_MRTD) { - DEBUG ((DEBUG_ERROR, "%a: MRTD cannot be extended in TDVF.\n", __FUNCT= ION__)); + DEBUG ((DEBUG_ERROR, "%a: MRTD cannot be extended in TDVF.\n", __func_= _)); return EFI_INVALID_PARAMETER; } =20 if (CcEvent->Header.MrIndex >=3D CC_MR_INDEX_INVALID) { - DEBUG ((DEBUG_ERROR, "%a: MrIndex is invalid. (%d)\n", __FUNCTION__, C= cEvent->Header.MrIndex)); + DEBUG ((DEBUG_ERROR, "%a: MrIndex is invalid. (%d)\n", __func__, CcEve= nt->Header.MrIndex)); return EFI_INVALID_PARAMETER; } =20 @@ -2514,7 +2514,7 @@ DriverEntry ( // // Cc measurement feature is crucial to a td-guest and it shall stop r= unning immediately // when it is failed to be installed. - DEBUG ((DEBUG_ERROR, "%a: CcMeasurement protocol failed to be installe= d - %r\n", __FUNCTION__, Status)); + DEBUG ((DEBUG_ERROR, "%a: CcMeasurement protocol failed to be installe= d - %r\n", __func__, Status)); CpuDeadLoop (); } =20 diff --git a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBo= otConfigImpl.c b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/Secu= reBootConfigImpl.c index 4299a6b5e56d..0e31502b1bfc 100644 --- a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfi= gImpl.c +++ b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfi= gImpl.c @@ -167,7 +167,7 @@ GetCurrentTime ( DEBUG (( DEBUG_ERROR, "%a(), GetTime() failed, status =3D '%r'\n", - __FUNCTION__, + __func__, Status )); return Status; diff --git a/SecurityPkg/VariableAuthenticated/SecureBootDefaultKeysDxe/Sec= ureBootDefaultKeysDxe.c b/SecurityPkg/VariableAuthenticated/SecureBootDefau= ltKeysDxe/SecureBootDefaultKeysDxe.c index 0abde52a05ae..2f6f3e6796bf 100644 --- a/SecurityPkg/VariableAuthenticated/SecureBootDefaultKeysDxe/SecureBoot= DefaultKeysDxe.c +++ b/SecurityPkg/VariableAuthenticated/SecureBootDefaultKeysDxe/SecureBoot= DefaultKeysDxe.c @@ -42,35 +42,35 @@ SecureBootDefaultKeysEntryPoint ( =20 Status =3D SecureBootInitPKDefault (); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a: Cannot initialize PKDefault: %r\n", __FUNCTI= ON__, Status)); + DEBUG ((DEBUG_ERROR, "%a: Cannot initialize PKDefault: %r\n", __func__= , Status)); return Status; } =20 Status =3D SecureBootInitKEKDefault (); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a: Cannot initialize KEKDefault: %r\n", __FUNCT= ION__, Status)); + DEBUG ((DEBUG_ERROR, "%a: Cannot initialize KEKDefault: %r\n", __func_= _, Status)); return Status; } =20 Status =3D SecureBootInitDbDefault (); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a: Cannot initialize dbDefault: %r\n", __FUNCTI= ON__, Status)); + DEBUG ((DEBUG_ERROR, "%a: Cannot initialize dbDefault: %r\n", __func__= , Status)); return Status; } =20 Status =3D SecureBootInitDbtDefault (); if (Status =3D=3D 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", __FUNCT= ION__, Status)); + DEBUG ((DEBUG_ERROR, "%a: Cannot initialize dbtDefault: %r\n", __func_= _, Status)); return Status; } =20 Status =3D SecureBootInitDbxDefault (); if (Status =3D=3D 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", __FUNCT= ION__, Status)); + DEBUG ((DEBUG_ERROR, "%a: Cannot initialize dbxDefault: %r\n", __func_= _, Status)); return Status; } =20 --=20 2.34.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#102636): https://edk2.groups.io/g/devel/message/102636 Mute This Topic: https://groups.io/mt/98115239/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-