public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Chen, Gang C" <gang.c.chen@intel.com>
To: devel@edk2.groups.io
Cc: Gang Chen <gang.c.chen@intel.com>, Ray Ni <ray.ni@intel.com>,
	Michael D Kinney <michael.d.kinney@intel.com>,
	Liming Gao <gaoliming@byosoft.com.cn>,
	Zhiguang Liu <zhiguang.liu@intel.com>
Subject: [PATCH] UefiPayloadPkg/PayloadLoaderPeim: remove GCC build warning
Date: Wed, 24 Aug 2022 22:27:01 +0800	[thread overview]
Message-ID: <20220824142701.3657728-1-gang.c.chen@intel.com> (raw)

Fix the gcc build warning:
variable PldInfo set but not used [-Wunused-but-set-variable]

Cc: Ray Ni <ray.ni@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Signed-off-by: Gang Chen <gang.c.chen@intel.com>
---
 UefiPayloadPkg/PayloadLoaderPeim/PayloadLoaderPeim.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/UefiPayloadPkg/PayloadLoaderPeim/PayloadLoaderPeim.c b/UefiPayloadPkg/PayloadLoaderPeim/PayloadLoaderPeim.c
index 9a2c3c148d..fba0e6cba5 100644
--- a/UefiPayloadPkg/PayloadLoaderPeim/PayloadLoaderPeim.c
+++ b/UefiPayloadPkg/PayloadLoaderPeim/PayloadLoaderPeim.c
@@ -48,7 +48,6 @@ PeiLoadFileLoadPayload (
   VOID                           *Elf;
   UNIVERSAL_PAYLOAD_EXTRA_DATA   *ExtraData;
   ELF_IMAGE_CONTEXT              Context;
-  UNIVERSAL_PAYLOAD_INFO_HEADER  *PldInfo;
   UINT32                         Index;
   UINT16                         ExtraDataIndex;
   CHAR8                          *SectionName;
@@ -85,7 +84,6 @@ PeiLoadFileLoadPayload (
   //
   // Get UNIVERSAL_PAYLOAD_INFO_HEADER and number of additional PLD sections.
   //
-  PldInfo        = NULL;
   ExtraDataCount = 0;
   for (Index = 0; Index < Context.ShNum; Index++) {
     Status = GetElfSectionName (&Context, Index, &SectionName);
@@ -96,9 +94,6 @@ PeiLoadFileLoadPayload (
     DEBUG ((DEBUG_INFO, "Payload Section[%d]: %a\n", Index, SectionName));
     if (AsciiStrCmp (SectionName, UNIVERSAL_PAYLOAD_INFO_SEC_NAME) == 0) {
       Status = GetElfSectionPos (&Context, Index, &Offset, &Size);
-      if (!EFI_ERROR (Status)) {
-        PldInfo = (UNIVERSAL_PAYLOAD_INFO_HEADER *)(Context.FileBase + Offset);
-      }
     } else if (AsciiStrnCmp (SectionName, UNIVERSAL_PAYLOAD_EXTRA_SEC_NAME_PREFIX, UNIVERSAL_PAYLOAD_EXTRA_SEC_NAME_PREFIX_LENGTH) == 0) {
       Status = GetElfSectionPos (&Context, Index, &Offset, &Size);
       if (!EFI_ERROR (Status)) {
-- 
2.35.1


             reply	other threads:[~2022-08-24 14:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-24 14:27 Chen, Gang C [this message]
2022-08-25  2:20 ` [PATCH] UefiPayloadPkg/PayloadLoaderPeim: remove GCC build warning Zhiguang Liu
2022-08-25  3:09   ` [edk2-devel] " Lu, James

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=20220824142701.3657728-1-gang.c.chen@intel.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