From ed9a64af1be2724362b50cf96281de7117ad7bff Mon Sep 17 00:00:00 2001 From: Dun Tan Date: Thu, 4 Jul 2024 15:15:15 +0800 Subject: SecurityPkg/Tcg2Config: avoid potential build error Cast pointer type to VOID* to avoid potential build error. If the two PCD are FixAtBuild, PcdGetPtr will return a const type pointer. Since the second parameter of BuildGuidDataHob is VOID*, build error may happen with following log: C4090: 'function': different 'const' qualifiers Signed-off-by: Dun Tan --- SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigPeim.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigPeim.c b/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigPeim.c index ce78e32..73121b0 100644 --- a/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigPeim.c +++ b/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigPeim.c @@ -190,7 +190,7 @@ Tcg2ConfigPeimEntryPoint ( // Hob = BuildGuidDataHob ( &gEdkiiTpmInstanceHobGuid, - PcdGetPtr (PcdTpmInstanceGuid), + (VOID *)PcdGetPtr (PcdTpmInstanceGuid), sizeof (EFI_GUID) ); ASSERT (Hob != NULL); @@ -200,7 +200,7 @@ Tcg2ConfigPeimEntryPoint ( // Hob = BuildGuidDataHob ( &gEdkiiTcgPhysicalPresenceInterfaceVerHobGuid, - PcdGetPtr (PcdTcgPhysicalPresenceInterfaceVer), + (VOID *)PcdGetPtr (PcdTcgPhysicalPresenceInterfaceVer), AsciiStrSize ((CHAR8 *)PcdGetPtr (PcdTcgPhysicalPresenceInterfaceVer)) ); ASSERT (Hob != NULL); -- cgit v1.1