Skip to content

Commit 24fd71d

Browse files
leiflindholmmergify[bot]
authored andcommitted
EmbeddedPkg/PrePiLib: eliminate unneeded variable in FfsProcessSection ()
The "Found" variable provided only a deferred form of success handling, so eliminate it to improve readability. Signed-off-by: Leif Lindholm <[email protected]>
1 parent 6b19b44 commit 24fd71d

File tree

1 file changed

+5
-9
lines changed
  • EmbeddedPkg/Library/PrePiLib

1 file changed

+5
-9
lines changed

EmbeddedPkg/Library/PrePiLib/FwVol.c

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -385,18 +385,14 @@ FfsProcessSection (
385385

386386
if (Section->Type == SectionType) {
387387
if (SectionCheckHook != NULL) {
388-
Found = SectionCheckHook (Section) == EFI_SUCCESS;
389-
} else {
390-
Found = TRUE;
388+
if (SectionCheckHook (Section) != EFI_SUCCESS) {
389+
goto CheckNextSection;
390+
}
391391
}
392392

393-
if (Found) {
394-
*OutputBuffer = (VOID *)((UINT8 *)Section + SectionHeaderSize);
393+
*OutputBuffer = (VOID *)((UINT8 *)Section + SectionHeaderSize);
395394

396-
return EFI_SUCCESS;
397-
} else {
398-
goto CheckNextSection;
399-
}
395+
return EFI_SUCCESS;
400396
} else if ((Section->Type == EFI_SECTION_COMPRESSION) || (Section->Type == EFI_SECTION_GUID_DEFINED)) {
401397
CHAR8 *CompressedData;
402398
UINT32 CompressionSectionHeaderSize;

0 commit comments

Comments
 (0)