summaryrefslogtreecommitdiffstats
path: root/UefiPayloadPkg
diff options
context:
space:
mode:
authorJames Lu <james.lu@intel.com>2022-09-15 16:48:07 +0800
committerJames Lu <james.lu@intel.com>2022-09-16 15:46:22 +0800
commit415fc406d6d8e9f8dee59d467108ee101670b545 (patch)
tree3451a9fe23f03e7ed60670fd8a6b228c8a4d2d1c /UefiPayloadPkg
parent3184e44df1042ae41c1cd8d2acaa47d7d30cd07c (diff)
downloadedk2-415fc406d6d8e9f8dee59d467108ee101670b545.tar.gz
edk2-415fc406d6d8e9f8dee59d467108ee101670b545.tar.bz2
edk2-415fc406d6d8e9f8dee59d467108ee101670b545.zip
UefiPayloadPkg/PayloadLoaderPeim: remove GCC build warning
Fix the gcc build warning: variable PldInfo set but not used [-Wunused-but-set-variable] Reviewed-by: James Lu <james.lu@intel.com> Reviewed-by: Zhiguang Liu <zhiguang.liu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: Gang Chen <gang.c.chen@intel.com>
Diffstat (limited to 'UefiPayloadPkg')
-rw-r--r--UefiPayloadPkg/PayloadLoaderPeim/PayloadLoaderPeim.c29
1 files changed, 12 insertions, 17 deletions
diff --git a/UefiPayloadPkg/PayloadLoaderPeim/PayloadLoaderPeim.c b/UefiPayloadPkg/PayloadLoaderPeim/PayloadLoaderPeim.c
index 9a2c3c148d..9f9d3c13e1 100644
--- a/UefiPayloadPkg/PayloadLoaderPeim/PayloadLoaderPeim.c
+++ b/UefiPayloadPkg/PayloadLoaderPeim/PayloadLoaderPeim.c
@@ -44,19 +44,18 @@ PeiLoadFileLoadPayload (
OUT UINT32 *AuthenticationState
)
{
- EFI_STATUS Status;
- VOID *Elf;
- UNIVERSAL_PAYLOAD_EXTRA_DATA *ExtraData;
- ELF_IMAGE_CONTEXT Context;
- UNIVERSAL_PAYLOAD_INFO_HEADER *PldInfo;
- UINT32 Index;
- UINT16 ExtraDataIndex;
- CHAR8 *SectionName;
- UINTN Offset;
- UINTN Size;
- UINT32 ExtraDataCount;
- UINTN Instance;
- UINTN Length;
+ EFI_STATUS Status;
+ VOID *Elf;
+ UNIVERSAL_PAYLOAD_EXTRA_DATA *ExtraData;
+ ELF_IMAGE_CONTEXT Context;
+ UINT32 Index;
+ UINT16 ExtraDataIndex;
+ CHAR8 *SectionName;
+ UINTN Offset;
+ UINTN Size;
+ UINT32 ExtraDataCount;
+ UINTN Instance;
+ UINTN Length;
//
// ELF is added to file as RAW section for EDKII bootloader.
@@ -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)) {