public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: icegambit91@gmail.com
To: devel@edk2.groups.io
Cc: Sahil Siddiq <icegambit91@gmail.com>
Subject: [PATCH] MdeModulePkg/SmmLockBoxLib: Remove dead code
Date: Thu, 26 Jan 2023 23:59:06 +0530	[thread overview]
Message-ID: <a710c003c48bfc55c81b7981c2dc523d2936e2ca.1674757685.git.icegambit91@gmail.com> (raw)

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


                 reply	other threads:[~2023-01-26 18:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a710c003c48bfc55c81b7981c2dc523d2936e2ca.1674757685.git.icegambit91@gmail.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox