]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.c
MdeModulePkg: Apply uncrustify changes
[mirror_edk2.git] / MdeModulePkg / Library / DxeCrc32GuidedSectionExtractLib / DxeCrc32GuidedSectionExtractLib.c
index 1c0904c8f0ab5a04726ee0a54b679c7d0ebb9b13..3e40dfa61880a1a0bba233bc2149e2623d9d5e2c 100644 (file)
@@ -21,13 +21,13 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 /// CRC32 Guided Section header\r
 ///\r
 typedef struct {\r
-  EFI_GUID_DEFINED_SECTION  GuidedSectionHeader; ///< EFI guided section header\r
-  UINT32                    CRC32Checksum;       ///< 32bit CRC check sum\r
+  EFI_GUID_DEFINED_SECTION    GuidedSectionHeader; ///< EFI guided section header\r
+  UINT32                      CRC32Checksum;       ///< 32bit CRC check sum\r
 } CRC32_SECTION_HEADER;\r
 \r
 typedef struct {\r
-  EFI_GUID_DEFINED_SECTION2 GuidedSectionHeader; ///< EFI guided section header\r
-  UINT32                    CRC32Checksum;       ///< 32bit CRC check sum\r
+  EFI_GUID_DEFINED_SECTION2    GuidedSectionHeader; ///< EFI guided section header\r
+  UINT32                       CRC32Checksum;       ///< 32bit CRC check sum\r
 } CRC32_SECTION2_HEADER;\r
 \r
 /**\r
@@ -60,31 +60,37 @@ Crc32GuidedSectionGetInfo (
     // Check whether the input guid section is recognized.\r
     //\r
     if (!CompareGuid (\r
-        &gEfiCrc32GuidedSectionExtractionGuid,\r
-        &(((EFI_GUID_DEFINED_SECTION2 *) InputSection)->SectionDefinitionGuid))) {\r
+           &gEfiCrc32GuidedSectionExtractionGuid,\r
+           &(((EFI_GUID_DEFINED_SECTION2 *)InputSection)->SectionDefinitionGuid)\r
+           ))\r
+    {\r
       return EFI_INVALID_PARAMETER;\r
     }\r
+\r
     //\r
     // Retrieve the size and attribute of the input section data.\r
     //\r
-    *SectionAttribute  = ((EFI_GUID_DEFINED_SECTION2 *) InputSection)->Attributes;\r
+    *SectionAttribute  = ((EFI_GUID_DEFINED_SECTION2 *)InputSection)->Attributes;\r
     *ScratchBufferSize = 0;\r
-    *OutputBufferSize  = SECTION2_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION2 *) InputSection)->DataOffset;\r
+    *OutputBufferSize  = SECTION2_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION2 *)InputSection)->DataOffset;\r
   } else {\r
     //\r
     // Check whether the input guid section is recognized.\r
     //\r
     if (!CompareGuid (\r
-        &gEfiCrc32GuidedSectionExtractionGuid,\r
-        &(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid))) {\r
+           &gEfiCrc32GuidedSectionExtractionGuid,\r
+           &(((EFI_GUID_DEFINED_SECTION *)InputSection)->SectionDefinitionGuid)\r
+           ))\r
+    {\r
       return EFI_INVALID_PARAMETER;\r
     }\r
+\r
     //\r
     // Retrieve the size and attribute of the input section data.\r
     //\r
-    *SectionAttribute  = ((EFI_GUID_DEFINED_SECTION *) InputSection)->Attributes;\r
+    *SectionAttribute  = ((EFI_GUID_DEFINED_SECTION *)InputSection)->Attributes;\r
     *ScratchBufferSize = 0;\r
-    *OutputBufferSize  = SECTION_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION *) InputSection)->DataOffset;\r
+    *OutputBufferSize  = SECTION_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION *)InputSection)->DataOffset;\r
   }\r
 \r
   return EFI_SUCCESS;\r
@@ -116,55 +122,59 @@ Crc32GuidedSectionHandler (
   OUT       UINT32  *AuthenticationStatus\r
   )\r
 {\r
-  EFI_STATUS                Status;\r
-  UINT32                    SectionCrc32Checksum;\r
-  UINT32                    Crc32Checksum;\r
-  UINT32                    OutputBufferSize;\r
-  VOID                      *DummyInterface;\r
+  EFI_STATUS  Status;\r
+  UINT32      SectionCrc32Checksum;\r
+  UINT32      Crc32Checksum;\r
+  UINT32      OutputBufferSize;\r
+  VOID        *DummyInterface;\r
 \r
   if (IS_SECTION2 (InputSection)) {\r
     //\r
     // Check whether the input guid section is recognized.\r
     //\r
     if (!CompareGuid (\r
-        &gEfiCrc32GuidedSectionExtractionGuid,\r
-        &(((EFI_GUID_DEFINED_SECTION2 *) InputSection)->SectionDefinitionGuid))) {\r
+           &gEfiCrc32GuidedSectionExtractionGuid,\r
+           &(((EFI_GUID_DEFINED_SECTION2 *)InputSection)->SectionDefinitionGuid)\r
+           ))\r
+    {\r
       return EFI_INVALID_PARAMETER;\r
     }\r
 \r
     //\r
     // Get section Crc32 checksum.\r
     //\r
-    SectionCrc32Checksum = ((CRC32_SECTION2_HEADER *) InputSection)->CRC32Checksum;\r
-    *OutputBuffer      = (UINT8 *) InputSection + ((EFI_GUID_DEFINED_SECTION2 *) InputSection)->DataOffset;\r
-    OutputBufferSize   = SECTION2_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION2 *) InputSection)->DataOffset;\r
+    SectionCrc32Checksum = ((CRC32_SECTION2_HEADER *)InputSection)->CRC32Checksum;\r
+    *OutputBuffer        = (UINT8 *)InputSection + ((EFI_GUID_DEFINED_SECTION2 *)InputSection)->DataOffset;\r
+    OutputBufferSize     = SECTION2_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION2 *)InputSection)->DataOffset;\r
 \r
     //\r
     // Implicitly CRC32 GUIDed section should have STATUS_VALID bit set\r
     //\r
-    ASSERT (((EFI_GUID_DEFINED_SECTION2 *) InputSection)->Attributes & EFI_GUIDED_SECTION_AUTH_STATUS_VALID);\r
+    ASSERT (((EFI_GUID_DEFINED_SECTION2 *)InputSection)->Attributes & EFI_GUIDED_SECTION_AUTH_STATUS_VALID);\r
     *AuthenticationStatus = EFI_AUTH_STATUS_IMAGE_SIGNED;\r
   } else {\r
     //\r
     // Check whether the input guid section is recognized.\r
     //\r
     if (!CompareGuid (\r
-        &gEfiCrc32GuidedSectionExtractionGuid,\r
-        &(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid))) {\r
+           &gEfiCrc32GuidedSectionExtractionGuid,\r
+           &(((EFI_GUID_DEFINED_SECTION *)InputSection)->SectionDefinitionGuid)\r
+           ))\r
+    {\r
       return EFI_INVALID_PARAMETER;\r
     }\r
 \r
     //\r
     // Get section Crc32 checksum.\r
     //\r
-    SectionCrc32Checksum = ((CRC32_SECTION_HEADER *) InputSection)->CRC32Checksum;\r
-    *OutputBuffer      = (UINT8 *) InputSection + ((EFI_GUID_DEFINED_SECTION *) InputSection)->DataOffset;\r
-    OutputBufferSize   = SECTION_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION *) InputSection)->DataOffset;\r
+    SectionCrc32Checksum = ((CRC32_SECTION_HEADER *)InputSection)->CRC32Checksum;\r
+    *OutputBuffer        = (UINT8 *)InputSection + ((EFI_GUID_DEFINED_SECTION *)InputSection)->DataOffset;\r
+    OutputBufferSize     = SECTION_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION *)InputSection)->DataOffset;\r
 \r
     //\r
     // Implicitly CRC32 GUIDed section should have STATUS_VALID bit set\r
     //\r
-    ASSERT (((EFI_GUID_DEFINED_SECTION *) InputSection)->Attributes & EFI_GUIDED_SECTION_AUTH_STATUS_VALID);\r
+    ASSERT (((EFI_GUID_DEFINED_SECTION *)InputSection)->Attributes & EFI_GUIDED_SECTION_AUTH_STATUS_VALID);\r
     *AuthenticationStatus = EFI_AUTH_STATUS_IMAGE_SIGNED;\r
   }\r
 \r
@@ -222,8 +232,8 @@ DxeCrc32GuidedSectionExtractLibConstructor (
   )\r
 {\r
   return ExtractGuidedSectionRegisterHandlers (\r
-          &gEfiCrc32GuidedSectionExtractionGuid,\r
-          Crc32GuidedSectionGetInfo,\r
-          Crc32GuidedSectionHandler\r
-          );\r
+           &gEfiCrc32GuidedSectionExtractionGuid,\r
+           Crc32GuidedSectionGetInfo,\r
+           Crc32GuidedSectionHandler\r
+           );\r
 }\r