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 <dun.tan@intel.com>
This commit is contained in:
Dun Tan 2024-07-04 15:15:15 +08:00 committed by mergify[bot]
parent 2809966189
commit ed9a64af1b

View File

@ -190,7 +190,7 @@ Tcg2ConfigPeimEntryPoint (
// //
Hob = BuildGuidDataHob ( Hob = BuildGuidDataHob (
&gEdkiiTpmInstanceHobGuid, &gEdkiiTpmInstanceHobGuid,
PcdGetPtr (PcdTpmInstanceGuid), (VOID *)PcdGetPtr (PcdTpmInstanceGuid),
sizeof (EFI_GUID) sizeof (EFI_GUID)
); );
ASSERT (Hob != NULL); ASSERT (Hob != NULL);
@ -200,7 +200,7 @@ Tcg2ConfigPeimEntryPoint (
// //
Hob = BuildGuidDataHob ( Hob = BuildGuidDataHob (
&gEdkiiTcgPhysicalPresenceInterfaceVerHobGuid, &gEdkiiTcgPhysicalPresenceInterfaceVerHobGuid,
PcdGetPtr (PcdTcgPhysicalPresenceInterfaceVer), (VOID *)PcdGetPtr (PcdTcgPhysicalPresenceInterfaceVer),
AsciiStrSize ((CHAR8 *)PcdGetPtr (PcdTcgPhysicalPresenceInterfaceVer)) AsciiStrSize ((CHAR8 *)PcdGetPtr (PcdTcgPhysicalPresenceInterfaceVer))
); );
ASSERT (Hob != NULL); ASSERT (Hob != NULL);