diff options
author | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-08-18 12:11:37 +0000 |
---|---|---|
committer | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-08-18 12:11:37 +0000 |
commit | b911d09f5525e5bb27d5c9dffcfd6120e095ac84 (patch) | |
tree | 657ff1575c56b81d968d90f29238313fae127816 /MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.c | |
parent | d1a44d08c1b221669e88f27801b3e4ae26d7fd96 (diff) | |
download | edk2-platforms-b911d09f5525e5bb27d5c9dffcfd6120e095ac84.tar.xz |
Code Clean up for IfrSupportLib, HiiLib, PeiExtractGuidedSectionLib and DxeExtractGuidedSectionLib,
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5687 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.c')
-rw-r--r-- | MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.c | 64 |
1 files changed, 26 insertions, 38 deletions
diff --git a/MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.c b/MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.c index 2b09c46cc9..72add417b6 100644 --- a/MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.c +++ b/MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.c @@ -196,20 +196,16 @@ ExtractGuidedSectionRegisterHandlers ( //
for (Index = 0; Index < HandlerInfo->NumberOfExtractHandler; Index ++) {
if (CompareGuid (HandlerInfo->ExtractHandlerGuidTable + Index, SectionGuid)) {
- break;
+ //
+ // If the guided handler has been registered before, only update its handler.
+ //
+ HandlerInfo->ExtractDecodeHandlerTable [Index] = DecodeHandler;
+ HandlerInfo->ExtractGetInfoHandlerTable [Index] = GetInfoHandler;
+ return RETURN_SUCCESS;
}
}
//
- // If the guided handler has been registered before, only update its handler.
- //
- if (Index < HandlerInfo->NumberOfExtractHandler) {
- HandlerInfo->ExtractDecodeHandlerTable [Index] = DecodeHandler;
- HandlerInfo->ExtractGetInfoHandlerTable [Index] = GetInfoHandler;
- return RETURN_SUCCESS;
- }
-
- //
// Check the global table is enough to contain new Handler.
//
if (HandlerInfo->NumberOfExtractHandler >= PcdGet32 (PcdMaximumGuidedExtractHandler)) {
@@ -284,26 +280,22 @@ ExtractGuidedSectionGetInfo ( //
for (Index = 0; Index < HandlerInfo->NumberOfExtractHandler; Index ++) {
if (CompareGuid (HandlerInfo->ExtractHandlerGuidTable + Index, &(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid))) {
- break;
+ //
+ // Call the match handler to getinfo for the input section data.
+ //
+ return HandlerInfo->ExtractGetInfoHandlerTable [Index] (
+ InputSection,
+ OutputBufferSize,
+ ScratchBufferSize,
+ SectionAttribute
+ );
}
}
//
// Not found, the input guided section is not supported.
//
- if (Index == HandlerInfo->NumberOfExtractHandler) {
- return RETURN_UNSUPPORTED;
- }
-
- //
- // Call the match handler to getinfo for the input section data.
- //
- return HandlerInfo->ExtractGetInfoHandlerTable [Index] (
- InputSection,
- OutputBufferSize,
- ScratchBufferSize,
- SectionAttribute
- );
+ return RETURN_UNSUPPORTED;
}
/** @@ -366,24 +358,20 @@ ExtractGuidedSectionDecode ( //
for (Index = 0; Index < HandlerInfo->NumberOfExtractHandler; Index ++) {
if (CompareGuid (HandlerInfo->ExtractHandlerGuidTable + Index, &(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid))) {
- break;
+ //
+ // Call the match handler to extract raw data for the input guided section.
+ //
+ return HandlerInfo->ExtractDecodeHandlerTable [Index] (
+ InputSection,
+ OutputBuffer,
+ ScratchBuffer,
+ AuthenticationStatus
+ );
}
}
//
// Not found, the input guided section is not supported.
//
- if (Index == HandlerInfo->NumberOfExtractHandler) {
- return RETURN_UNSUPPORTED;
- }
-
- //
- // Call the match handler to extract raw data for the input guided section.
- //
- return HandlerInfo->ExtractDecodeHandlerTable [Index] (
- InputSection,
- OutputBuffer,
- ScratchBuffer,
- AuthenticationStatus
- );
+ return RETURN_UNSUPPORTED;
}
|