summaryrefslogtreecommitdiffstats
path: root/MdePkg/Library/DxeExtractGuidedSectionLib
diff options
context:
space:
mode:
authorMichael Kubacki <michael.kubacki@microsoft.com>2021-12-05 14:54:05 -0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-12-07 17:24:28 +0000
commit2f88bd3a1296c522317f1c21377876de63de5be7 (patch)
treeba47875489cc5698061275a495983e9dea3be098 /MdePkg/Library/DxeExtractGuidedSectionLib
parent1436aea4d5707e672672a11bda72be2c63c936c3 (diff)
downloadedk2-2f88bd3a1296c522317f1c21377876de63de5be7.tar.gz
edk2-2f88bd3a1296c522317f1c21377876de63de5be7.tar.bz2
edk2-2f88bd3a1296c522317f1c21377876de63de5be7.zip
MdePkg: Apply uncrustify changes
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the MdePkg package Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Diffstat (limited to 'MdePkg/Library/DxeExtractGuidedSectionLib')
-rw-r--r--MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.c105
1 files changed, 55 insertions, 50 deletions
diff --git a/MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.c b/MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.c
index 995ef1dd7e..2634d2f44f 100644
--- a/MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.c
+++ b/MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.c
@@ -14,14 +14,14 @@
#include <Library/ExtractGuidedSectionLib.h>
#include <Library/UefiBootServicesTableLib.h>
-#define EXTRACT_HANDLER_TABLE_SIZE 0x10
+#define EXTRACT_HANDLER_TABLE_SIZE 0x10
-UINT32 mNumberOfExtractHandler = 0;
-UINT32 mMaxNumberOfExtractHandler = 0;
+UINT32 mNumberOfExtractHandler = 0;
+UINT32 mMaxNumberOfExtractHandler = 0;
-GUID *mExtractHandlerGuidTable = NULL;
-EXTRACT_GUIDED_SECTION_DECODE_HANDLER *mExtractDecodeHandlerTable = NULL;
-EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER *mExtractGetInfoHandlerTable = NULL;
+GUID *mExtractHandlerGuidTable = NULL;
+EXTRACT_GUIDED_SECTION_DECODE_HANDLER *mExtractDecodeHandlerTable = NULL;
+EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER *mExtractGetInfoHandlerTable = NULL;
/**
Reallocates more global memory to store the registered guid and Handler list.
@@ -42,7 +42,7 @@ ReallocateExtractHandlerTable (
mMaxNumberOfExtractHandler * sizeof (GUID),
(mMaxNumberOfExtractHandler + EXTRACT_HANDLER_TABLE_SIZE) * sizeof (GUID),
mExtractHandlerGuidTable
- );
+ );
if (mExtractHandlerGuidTable == NULL) {
goto Done;
@@ -52,10 +52,10 @@ ReallocateExtractHandlerTable (
// Reallocate memory for Decode handler Table
//
mExtractDecodeHandlerTable = ReallocatePool (
- mMaxNumberOfExtractHandler * sizeof (EXTRACT_GUIDED_SECTION_DECODE_HANDLER),
- (mMaxNumberOfExtractHandler + EXTRACT_HANDLER_TABLE_SIZE) * sizeof (EXTRACT_GUIDED_SECTION_DECODE_HANDLER),
- mExtractDecodeHandlerTable
- );
+ mMaxNumberOfExtractHandler * sizeof (EXTRACT_GUIDED_SECTION_DECODE_HANDLER),
+ (mMaxNumberOfExtractHandler + EXTRACT_HANDLER_TABLE_SIZE) * sizeof (EXTRACT_GUIDED_SECTION_DECODE_HANDLER),
+ mExtractDecodeHandlerTable
+ );
if (mExtractDecodeHandlerTable == NULL) {
goto Done;
@@ -65,10 +65,10 @@ ReallocateExtractHandlerTable (
// Reallocate memory for GetInfo handler Table
//
mExtractGetInfoHandlerTable = ReallocatePool (
- mMaxNumberOfExtractHandler * sizeof (EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER),
- (mMaxNumberOfExtractHandler + EXTRACT_HANDLER_TABLE_SIZE) * sizeof (EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER),
- mExtractGetInfoHandlerTable
- );
+ mMaxNumberOfExtractHandler * sizeof (EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER),
+ (mMaxNumberOfExtractHandler + EXTRACT_HANDLER_TABLE_SIZE) * sizeof (EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER),
+ mExtractGetInfoHandlerTable
+ );
if (mExtractGetInfoHandlerTable == NULL) {
goto Done;
@@ -84,15 +84,18 @@ Done:
if (mExtractHandlerGuidTable != NULL) {
FreePool (mExtractHandlerGuidTable);
}
+
if (mExtractDecodeHandlerTable != NULL) {
FreePool (mExtractDecodeHandlerTable);
}
+
if (mExtractGetInfoHandlerTable != NULL) {
FreePool (mExtractGetInfoHandlerTable);
}
return RETURN_OUT_OF_RESOURCES;
}
+
/**
Constructor allocates the global memory to store the registered guid and Handler list.
@@ -170,8 +173,8 @@ ExtractGuidedSectionRegisterHandlers (
IN EXTRACT_GUIDED_SECTION_DECODE_HANDLER DecodeHandler
)
{
- UINT32 Index;
- VOID *GuidData;
+ UINT32 Index;
+ VOID *GuidData;
//
// Check input parameter.
@@ -183,13 +186,13 @@ ExtractGuidedSectionRegisterHandlers (
//
// Search the match registered GetInfo handler for the input guided section.
//
- for (Index = 0; Index < mNumberOfExtractHandler; Index ++) {
+ for (Index = 0; Index < mNumberOfExtractHandler; Index++) {
if (CompareGuid (&mExtractHandlerGuidTable[Index], SectionGuid)) {
//
// If the guided handler has been registered before, only update its handler.
//
- mExtractDecodeHandlerTable [Index] = DecodeHandler;
- mExtractGetInfoHandlerTable [Index] = GetInfoHandler;
+ mExtractDecodeHandlerTable[Index] = DecodeHandler;
+ mExtractGetInfoHandlerTable[Index] = GetInfoHandler;
return RETURN_SUCCESS;
}
}
@@ -206,17 +209,17 @@ ExtractGuidedSectionRegisterHandlers (
//
// Register new Handler and guid value.
//
- CopyGuid (&mExtractHandlerGuidTable [mNumberOfExtractHandler], SectionGuid);
- mExtractDecodeHandlerTable [mNumberOfExtractHandler] = DecodeHandler;
- mExtractGetInfoHandlerTable [mNumberOfExtractHandler++] = GetInfoHandler;
+ CopyGuid (&mExtractHandlerGuidTable[mNumberOfExtractHandler], SectionGuid);
+ mExtractDecodeHandlerTable[mNumberOfExtractHandler] = DecodeHandler;
+ mExtractGetInfoHandlerTable[mNumberOfExtractHandler++] = GetInfoHandler;
//
// Install the Guided Section GUID configuration table to record the GUID itself.
// Then the content of the configuration table buffer will be the same as the GUID value itself.
//
- GuidData = AllocateCopyPool (sizeof (GUID), (VOID *) SectionGuid);
+ GuidData = AllocateCopyPool (sizeof (GUID), (VOID *)SectionGuid);
if (GuidData != NULL) {
- gBS->InstallConfigurationTable ((EFI_GUID *) SectionGuid, GuidData);
+ gBS->InstallConfigurationTable ((EFI_GUID *)SectionGuid, GuidData);
}
return RETURN_SUCCESS;
@@ -265,8 +268,8 @@ ExtractGuidedSectionGetInfo (
OUT UINT16 *SectionAttribute
)
{
- UINT32 Index;
- EFI_GUID *SectionDefinitionGuid;
+ UINT32 Index;
+ EFI_GUID *SectionDefinitionGuid;
ASSERT (InputSection != NULL);
ASSERT (OutputBufferSize != NULL);
@@ -274,25 +277,25 @@ ExtractGuidedSectionGetInfo (
ASSERT (SectionAttribute != NULL);
if (IS_SECTION2 (InputSection)) {
- SectionDefinitionGuid = &(((EFI_GUID_DEFINED_SECTION2 *) InputSection)->SectionDefinitionGuid);
+ SectionDefinitionGuid = &(((EFI_GUID_DEFINED_SECTION2 *)InputSection)->SectionDefinitionGuid);
} else {
- SectionDefinitionGuid = &(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid);
+ SectionDefinitionGuid = &(((EFI_GUID_DEFINED_SECTION *)InputSection)->SectionDefinitionGuid);
}
//
// Search the match registered GetInfo handler for the input guided section.
//
- for (Index = 0; Index < mNumberOfExtractHandler; Index ++) {
+ for (Index = 0; Index < mNumberOfExtractHandler; Index++) {
if (CompareGuid (&mExtractHandlerGuidTable[Index], SectionDefinitionGuid)) {
//
// Call the match handler to getinfo for the input section data.
//
- return mExtractGetInfoHandlerTable [Index] (
- InputSection,
- OutputBufferSize,
- ScratchBufferSize,
- SectionAttribute
- );
+ return mExtractGetInfoHandlerTable[Index](
+ InputSection,
+ OutputBufferSize,
+ ScratchBufferSize,
+ SectionAttribute
+ );
}
}
@@ -346,8 +349,8 @@ ExtractGuidedSectionDecode (
OUT UINT32 *AuthenticationStatus
)
{
- UINT32 Index;
- EFI_GUID *SectionDefinitionGuid;
+ UINT32 Index;
+ EFI_GUID *SectionDefinitionGuid;
//
// Check the input parameters
@@ -357,25 +360,25 @@ ExtractGuidedSectionDecode (
ASSERT (AuthenticationStatus != NULL);
if (IS_SECTION2 (InputSection)) {
- SectionDefinitionGuid = &(((EFI_GUID_DEFINED_SECTION2 *) InputSection)->SectionDefinitionGuid);
+ SectionDefinitionGuid = &(((EFI_GUID_DEFINED_SECTION2 *)InputSection)->SectionDefinitionGuid);
} else {
- SectionDefinitionGuid = &(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid);
+ SectionDefinitionGuid = &(((EFI_GUID_DEFINED_SECTION *)InputSection)->SectionDefinitionGuid);
}
//
// Search the match registered extract handler for the input guided section.
//
- for (Index = 0; Index < mNumberOfExtractHandler; Index ++) {
+ for (Index = 0; Index < mNumberOfExtractHandler; Index++) {
if (CompareGuid (&mExtractHandlerGuidTable[Index], SectionDefinitionGuid)) {
//
// Call the match handler to extract raw data for the input section data.
//
- return mExtractDecodeHandlerTable [Index] (
- InputSection,
- OutputBuffer,
- ScratchBuffer,
- AuthenticationStatus
- );
+ return mExtractDecodeHandlerTable[Index](
+ InputSection,
+ OutputBuffer,
+ ScratchBuffer,
+ AuthenticationStatus
+ );
}
}
@@ -420,7 +423,7 @@ ExtractGuidedSectionGetHandlers (
OUT EXTRACT_GUIDED_SECTION_DECODE_HANDLER *DecodeHandler OPTIONAL
)
{
- UINT32 Index;
+ UINT32 Index;
//
// Check input parameter.
@@ -430,20 +433,22 @@ ExtractGuidedSectionGetHandlers (
//
// Search the match registered GetInfo handler for the input guided section.
//
- for (Index = 0; Index < mNumberOfExtractHandler; Index ++) {
+ for (Index = 0; Index < mNumberOfExtractHandler; Index++) {
if (CompareGuid (&mExtractHandlerGuidTable[Index], SectionGuid)) {
-
//
// If the guided handler has been registered before, then return the registered handlers.
//
if (GetInfoHandler != NULL) {
*GetInfoHandler = mExtractGetInfoHandlerTable[Index];
}
+
if (DecodeHandler != NULL) {
*DecodeHandler = mExtractDecodeHandlerTable[Index];
}
+
return RETURN_SUCCESS;
}
}
+
return RETURN_NOT_FOUND;
}