summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Library/PeiCrc32GuidedSectionExtractLib
diff options
context:
space:
mode:
authorMichael Kubacki <michael.kubacki@microsoft.com>2021-12-05 14:54:02 -0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-12-07 17:24:28 +0000
commit1436aea4d5707e672672a11bda72be2c63c936c3 (patch)
tree370c9d5bd8823aa8ea7bce71a0f29bff71feff67 /MdeModulePkg/Library/PeiCrc32GuidedSectionExtractLib
parent7c7184e201a90a1d2376e615e55e3f4074731468 (diff)
downloadedk2-1436aea4d5707e672672a11bda72be2c63c936c3.tar.gz
edk2-1436aea4d5707e672672a11bda72be2c63c936c3.tar.bz2
edk2-1436aea4d5707e672672a11bda72be2c63c936c3.zip
MdeModulePkg: Apply uncrustify changes
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the MdeModulePkg 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 'MdeModulePkg/Library/PeiCrc32GuidedSectionExtractLib')
-rw-r--r--MdeModulePkg/Library/PeiCrc32GuidedSectionExtractLib/PeiCrc32GuidedSectionExtractLib.c76
1 files changed, 43 insertions, 33 deletions
diff --git a/MdeModulePkg/Library/PeiCrc32GuidedSectionExtractLib/PeiCrc32GuidedSectionExtractLib.c b/MdeModulePkg/Library/PeiCrc32GuidedSectionExtractLib/PeiCrc32GuidedSectionExtractLib.c
index 4bd4e4b32e..63f149e7e0 100644
--- a/MdeModulePkg/Library/PeiCrc32GuidedSectionExtractLib/PeiCrc32GuidedSectionExtractLib.c
+++ b/MdeModulePkg/Library/PeiCrc32GuidedSectionExtractLib/PeiCrc32GuidedSectionExtractLib.c
@@ -19,13 +19,13 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
/// CRC32 Guided Section header
///
typedef struct {
- EFI_GUID_DEFINED_SECTION GuidedSectionHeader; ///< EFI guided section header
- UINT32 CRC32Checksum; ///< 32bit CRC check sum
+ EFI_GUID_DEFINED_SECTION GuidedSectionHeader; ///< EFI guided section header
+ UINT32 CRC32Checksum; ///< 32bit CRC check sum
} CRC32_SECTION_HEADER;
typedef struct {
- EFI_GUID_DEFINED_SECTION2 GuidedSectionHeader; ///< EFI guided section header
- UINT32 CRC32Checksum; ///< 32bit CRC check sum
+ EFI_GUID_DEFINED_SECTION2 GuidedSectionHeader; ///< EFI guided section header
+ UINT32 CRC32Checksum; ///< 32bit CRC check sum
} CRC32_SECTION2_HEADER;
/**
@@ -58,31 +58,37 @@ Crc32GuidedSectionGetInfo (
// Check whether the input guid section is recognized.
//
if (!CompareGuid (
- &gEfiCrc32GuidedSectionExtractionGuid,
- &(((EFI_GUID_DEFINED_SECTION2 *) InputSection)->SectionDefinitionGuid))) {
+ &gEfiCrc32GuidedSectionExtractionGuid,
+ &(((EFI_GUID_DEFINED_SECTION2 *)InputSection)->SectionDefinitionGuid)
+ ))
+ {
return EFI_INVALID_PARAMETER;
}
+
//
// Retrieve the size and attribute of the input section data.
//
- *SectionAttribute = ((EFI_GUID_DEFINED_SECTION2 *) InputSection)->Attributes;
+ *SectionAttribute = ((EFI_GUID_DEFINED_SECTION2 *)InputSection)->Attributes;
*ScratchBufferSize = 0;
- *OutputBufferSize = SECTION2_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION2 *) InputSection)->DataOffset;
+ *OutputBufferSize = SECTION2_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION2 *)InputSection)->DataOffset;
} else {
//
// Check whether the input guid section is recognized.
//
if (!CompareGuid (
- &gEfiCrc32GuidedSectionExtractionGuid,
- &(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid))) {
+ &gEfiCrc32GuidedSectionExtractionGuid,
+ &(((EFI_GUID_DEFINED_SECTION *)InputSection)->SectionDefinitionGuid)
+ ))
+ {
return EFI_INVALID_PARAMETER;
}
+
//
// Retrieve the size and attribute of the input section data.
//
- *SectionAttribute = ((EFI_GUID_DEFINED_SECTION *) InputSection)->Attributes;
+ *SectionAttribute = ((EFI_GUID_DEFINED_SECTION *)InputSection)->Attributes;
*ScratchBufferSize = 0;
- *OutputBufferSize = SECTION_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION *) InputSection)->DataOffset;
+ *OutputBufferSize = SECTION_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION *)InputSection)->DataOffset;
}
return EFI_SUCCESS;
@@ -114,53 +120,57 @@ Crc32GuidedSectionHandler (
OUT UINT32 *AuthenticationStatus
)
{
- UINT32 SectionCrc32Checksum;
- UINT32 Crc32Checksum;
- UINT32 OutputBufferSize;
+ UINT32 SectionCrc32Checksum;
+ UINT32 Crc32Checksum;
+ UINT32 OutputBufferSize;
if (IS_SECTION2 (InputSection)) {
//
// Check whether the input guid section is recognized.
//
if (!CompareGuid (
- &gEfiCrc32GuidedSectionExtractionGuid,
- &(((EFI_GUID_DEFINED_SECTION2 *) InputSection)->SectionDefinitionGuid))) {
+ &gEfiCrc32GuidedSectionExtractionGuid,
+ &(((EFI_GUID_DEFINED_SECTION2 *)InputSection)->SectionDefinitionGuid)
+ ))
+ {
return EFI_INVALID_PARAMETER;
}
//
// Get section Crc32 checksum.
//
- SectionCrc32Checksum = ((CRC32_SECTION2_HEADER *) InputSection)->CRC32Checksum;
- *OutputBuffer = (UINT8 *) InputSection + ((EFI_GUID_DEFINED_SECTION2 *) InputSection)->DataOffset;
- OutputBufferSize = SECTION2_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION2 *) InputSection)->DataOffset;
+ SectionCrc32Checksum = ((CRC32_SECTION2_HEADER *)InputSection)->CRC32Checksum;
+ *OutputBuffer = (UINT8 *)InputSection + ((EFI_GUID_DEFINED_SECTION2 *)InputSection)->DataOffset;
+ OutputBufferSize = SECTION2_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION2 *)InputSection)->DataOffset;
//
// Implicitly CRC32 GUIDed section should have STATUS_VALID bit set
//
- ASSERT (((EFI_GUID_DEFINED_SECTION2 *) InputSection)->Attributes & EFI_GUIDED_SECTION_AUTH_STATUS_VALID);
+ ASSERT (((EFI_GUID_DEFINED_SECTION2 *)InputSection)->Attributes & EFI_GUIDED_SECTION_AUTH_STATUS_VALID);
*AuthenticationStatus = EFI_AUTH_STATUS_IMAGE_SIGNED;
} else {
//
// Check whether the input guid section is recognized.
//
if (!CompareGuid (
- &gEfiCrc32GuidedSectionExtractionGuid,
- &(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid))) {
+ &gEfiCrc32GuidedSectionExtractionGuid,
+ &(((EFI_GUID_DEFINED_SECTION *)InputSection)->SectionDefinitionGuid)
+ ))
+ {
return EFI_INVALID_PARAMETER;
}
//
// Get section Crc32 checksum.
//
- SectionCrc32Checksum = ((CRC32_SECTION_HEADER *) InputSection)->CRC32Checksum;
- *OutputBuffer = (UINT8 *) InputSection + ((EFI_GUID_DEFINED_SECTION *) InputSection)->DataOffset;
- OutputBufferSize = SECTION_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION *) InputSection)->DataOffset;
+ SectionCrc32Checksum = ((CRC32_SECTION_HEADER *)InputSection)->CRC32Checksum;
+ *OutputBuffer = (UINT8 *)InputSection + ((EFI_GUID_DEFINED_SECTION *)InputSection)->DataOffset;
+ OutputBufferSize = SECTION_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION *)InputSection)->DataOffset;
//
// Implicitly CRC32 GUIDed section should have STATUS_VALID bit set
//
- ASSERT (((EFI_GUID_DEFINED_SECTION *) InputSection)->Attributes & EFI_GUIDED_SECTION_AUTH_STATUS_VALID);
+ ASSERT (((EFI_GUID_DEFINED_SECTION *)InputSection)->Attributes & EFI_GUIDED_SECTION_AUTH_STATUS_VALID);
*AuthenticationStatus = EFI_AUTH_STATUS_IMAGE_SIGNED;
}
@@ -198,13 +208,13 @@ Crc32GuidedSectionHandler (
EFI_STATUS
EFIAPI
PeiCrc32GuidedSectionExtractLibConstructor (
- IN EFI_PEI_FILE_HANDLE FileHandle,
- IN CONST EFI_PEI_SERVICES **PeiServices
+ IN EFI_PEI_FILE_HANDLE FileHandle,
+ IN CONST EFI_PEI_SERVICES **PeiServices
)
{
return ExtractGuidedSectionRegisterHandlers (
- &gEfiCrc32GuidedSectionExtractionGuid,
- Crc32GuidedSectionGetInfo,
- Crc32GuidedSectionHandler
- );
+ &gEfiCrc32GuidedSectionExtractionGuid,
+ Crc32GuidedSectionGetInfo,
+ Crc32GuidedSectionHandler
+ );
}