Skip to content

Commit 7410754

Browse files
SecurityPkg/HashLibTpm2: Fix unused variable usage
There is an unused variable in SecurityPkg/Library/HashLibTpm2/HashLibTpm2PeilessSecLib.c which is spotted by CLANG builds. The correct fix here is not to just remove the unused assignment, but rather to fix the line following it, which should have been using the unused value in the way that it now does. Fixes: tianocore/edk2@9c651ef Co-authored-by: Ard Biesheuvel <[email protected]> Signed-off-by: Mike Beaton <[email protected]>
1 parent aacfbe6 commit 7410754

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

SecurityPkg/Library/HashLibTpm2/HashLibTpm2PeilessSecLib.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -586,9 +586,7 @@ HasLibTpm2PeilessSecLibConstructor (
586586
}
587587

588588
TcgPcrEvent = (TCG_PCR_EVENT *)EventLog;
589-
TcgEfiSpecIdEventStruct = (TCG_EfiSpecIDEventStruct *)
590-
(EventLog + OFFSET_OF (TCG_PCR_EVENT, Event));
591-
589+
TcgEfiSpecIdEventStruct = (TCG_EfiSpecIDEventStruct *)TcgPcrEvent->Event;
592590
CopyMem (&NumberOfAlgorithms, TcgEfiSpecIdEventStruct + 1, sizeof (NumberOfAlgorithms));
593591
DigestSize = (TCG_EfiSpecIdEventAlgorithmSize *)((UINT8 *)TcgEfiSpecIdEventStruct + sizeof (*TcgEfiSpecIdEventStruct) + sizeof (NumberOfAlgorithms));
594592

0 commit comments

Comments
 (0)