* [PATCH] UefiPayloadPkg/PayloadLoaderPeim: remove GCC build warning
@ 2022-08-24 14:27 Chen, Gang C
2022-08-25 2:20 ` Zhiguang Liu
0 siblings, 1 reply; 3+ messages in thread
From: Chen, Gang C @ 2022-08-24 14:27 UTC (permalink / raw)
To: devel; +Cc: Gang Chen, Ray Ni, Michael D Kinney, Liming Gao, Zhiguang Liu
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] UefiPayloadPkg/PayloadLoaderPeim: remove GCC build warning
2022-08-24 14:27 [PATCH] UefiPayloadPkg/PayloadLoaderPeim: remove GCC build warning Chen, Gang C
@ 2022-08-25 2:20 ` Zhiguang Liu
2022-08-25 3:09 ` [edk2-devel] " Lu, James
0 siblings, 1 reply; 3+ messages in thread
From: Zhiguang Liu @ 2022-08-25 2:20 UTC (permalink / raw)
To: Chen, Gang C, devel@edk2.groups.io
Cc: Ni, Ray, Kinney, Michael D, Gao, Liming
Reviewed-by: Zhiguang Liu <zhiguang.liu@intel.com>
> -----Original Message-----
> From: Chen, Gang C <gang.c.chen@intel.com>
> Sent: Wednesday, August 24, 2022 10:27 PM
> To: devel@edk2.groups.io
> Cc: Chen, Gang C <gang.c.chen@intel.com>; Ni, Ray <ray.ni@intel.com>;
> Kinney, Michael D <michael.d.kinney@intel.com>; Gao, Liming
> <gaoliming@byosoft.com.cn>; Liu, Zhiguang <zhiguang.liu@intel.com>
> Subject: [PATCH] UefiPayloadPkg/PayloadLoaderPeim: remove GCC build
> warning
>
> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [edk2-devel] [PATCH] UefiPayloadPkg/PayloadLoaderPeim: remove GCC build warning
2022-08-25 2:20 ` Zhiguang Liu
@ 2022-08-25 3:09 ` Lu, James
0 siblings, 0 replies; 3+ messages in thread
From: Lu, James @ 2022-08-25 3:09 UTC (permalink / raw)
To: devel@edk2.groups.io, Liu, Zhiguang, Chen, Gang C
Cc: Ni, Ray, Kinney, Michael D, Gao, Liming
Reviewed-by: James Lu <james.lu@intel.com>
Thanks,
James
-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Zhiguang Liu
Sent: Thursday, August 25, 2022 10:21 AM
To: Chen, Gang C <gang.c.chen@intel.com>; devel@edk2.groups.io
Cc: Ni, Ray <ray.ni@intel.com>; Kinney, Michael D <michael.d.kinney@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>
Subject: Re: [edk2-devel] [PATCH] UefiPayloadPkg/PayloadLoaderPeim: remove GCC build warning
Reviewed-by: Zhiguang Liu <zhiguang.liu@intel.com>
> -----Original Message-----
> From: Chen, Gang C <gang.c.chen@intel.com>
> Sent: Wednesday, August 24, 2022 10:27 PM
> To: devel@edk2.groups.io
> Cc: Chen, Gang C <gang.c.chen@intel.com>; Ni, Ray <ray.ni@intel.com>;
> Kinney, Michael D <michael.d.kinney@intel.com>; Gao, Liming
> <gaoliming@byosoft.com.cn>; Liu, Zhiguang <zhiguang.liu@intel.com>
> Subject: [PATCH] UefiPayloadPkg/PayloadLoaderPeim: remove GCC build
> warning
>
> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-08-25 3:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-24 14:27 [PATCH] UefiPayloadPkg/PayloadLoaderPeim: remove GCC build warning Chen, Gang C
2022-08-25 2:20 ` Zhiguang Liu
2022-08-25 3:09 ` [edk2-devel] " Lu, James
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox