]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.c
Code Scrub for DxeCrc32GuidedSectionExtractLib library instance.
[mirror_edk2.git] / MdeModulePkg / Library / DxeCrc32GuidedSectionExtractLib / DxeCrc32GuidedSectionExtractLib.c
index 99f728510853c82dbc46d650a69cb7be7da16c3d..7271108c4033f5392aede1e103d2978e86585735 100644 (file)
@@ -22,6 +22,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Library/BaseMemoryLib.h>\r
 #include <Library/UefiBootServicesTableLib.h>\r
 \r
+#define EFI_SECITON_SIZE_MASK 0x00ffffff\r
+\r
 typedef struct {\r
   EFI_GUID_DEFINED_SECTION  GuidedSectionHeader;\r
   UINT32                    CRC32Checksum;\r
@@ -64,7 +66,7 @@ Crc32GuidedSectionGetInfo (
   //\r
   *SectionAttribute  = ((EFI_GUID_DEFINED_SECTION *) InputSection)->Attributes;\r
   *ScratchBufferSize = 0;\r
-  *OutputBufferSize  = *(UINT32 *) (((EFI_COMMON_SECTION_HEADER *) InputSection)->Size) & 0x00ffffff;\r
+  *OutputBufferSize  = *(UINT32 *) (((EFI_COMMON_SECTION_HEADER *) InputSection)->Size) & EFI_SECITON_SIZE_MASK;\r
   *OutputBufferSize  -= ((EFI_GUID_DEFINED_SECTION *) InputSection)->DataOffset;\r
 \r
   return EFI_SUCCESS;\r
@@ -117,7 +119,7 @@ Crc32GuidedSectionHandler (
   //\r
   Crc32SectionHeader = (CRC32_SECTION_HEADER *) InputSection;\r
   *OutputBuffer      = (UINT8 *) InputSection + Crc32SectionHeader->GuidedSectionHeader.DataOffset;\r
-  OutputBufferSize   = *(UINT32 *) (((EFI_COMMON_SECTION_HEADER *) InputSection)->Size) & 0x00ffffff\r
+  OutputBufferSize   = *(UINT32 *) (((EFI_COMMON_SECTION_HEADER *) InputSection)->Size) & EFI_SECITON_SIZE_MASK\r
   OutputBufferSize   -= Crc32SectionHeader->GuidedSectionHeader.DataOffset;\r
 \r
   //\r