[edk2-devel] [PATCH] MdeModulePkg/SmmLockBoxLib: Remove dead code

Sahil Siddiq posted 1 patch 1 year, 3 months ago
Failed in applying to current master (apply log)
MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxPeiLib.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
[edk2-devel] [PATCH] MdeModulePkg/SmmLockBoxLib: Remove dead code
Posted by Sahil Siddiq 1 year, 3 months ago
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4317

The "if" condition on line 554 ensures that Guid won't be NULL (or 0) on line 600.
So, there will never be a situation where the "else" block on line 603 is executed.

Signed-off-by: Sahil Siddiq <icegambit91@gmail.com>
---
 MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxPeiLib.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxPeiLib.c b/MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxPeiLib.c
index 69d4c42ad1..9326158bd4 100644
--- a/MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxPeiLib.c
+++ b/MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxPeiLib.c
@@ -597,11 +597,7 @@ RestoreLockBox (
   LockBoxParameterRestore->Header.Command      = EFI_SMM_LOCK_BOX_COMMAND_RESTORE;
   LockBoxParameterRestore->Header.DataLength   = sizeof (*LockBoxParameterRestore);
   LockBoxParameterRestore->Header.ReturnStatus = (UINT64)-1;
-  if (Guid != 0) {
-    CopyMem (&LockBoxParameterRestore->Guid, Guid, sizeof (*Guid));
-  } else {
-    ZeroMem (&LockBoxParameterRestore->Guid, sizeof (*Guid));
-  }
+  CopyMem (&LockBoxParameterRestore->Guid, Guid, sizeof (*Guid));
 
   LockBoxParameterRestore->Buffer = (EFI_PHYSICAL_ADDRESS)(UINTN)Buffer;
   if (Length != NULL) {
-- 
2.39.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#99094): https://edk2.groups.io/g/devel/message/99094
Mute This Topic: https://groups.io/mt/96551254/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-