X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdePkg%2FLibrary%2FBaseUefiDecompressLib%2FBaseUefiTianoCustomDecompressLib.c;fp=MdePkg%2FLibrary%2FBaseUefiDecompressLib%2FBaseUefiTianoCustomDecompressLib.c;h=503e3cac6075fd40899d89d46500d72cefe11e5a;hp=59e3b08456fb46e40413aeeda25db5c556a54a0e;hb=2f88bd3a1296c522317f1c21377876de63de5be7;hpb=1436aea4d5707e672672a11bda72be2c63c936c3 diff --git a/MdePkg/Library/BaseUefiDecompressLib/BaseUefiTianoCustomDecompressLib.c b/MdePkg/Library/BaseUefiDecompressLib/BaseUefiTianoCustomDecompressLib.c index 59e3b08456..503e3cac60 100644 --- a/MdePkg/Library/BaseUefiDecompressLib/BaseUefiTianoCustomDecompressLib.c +++ b/MdePkg/Library/BaseUefiDecompressLib/BaseUefiTianoCustomDecompressLib.c @@ -62,41 +62,47 @@ TianoDecompressGetInfo ( if (IS_SECTION2 (InputSection)) { if (!CompareGuid ( - &gTianoCustomDecompressGuid, - &(((EFI_GUID_DEFINED_SECTION2 *) InputSection)->SectionDefinitionGuid))) { + &gTianoCustomDecompressGuid, + &(((EFI_GUID_DEFINED_SECTION2 *)InputSection)->SectionDefinitionGuid) + )) + { return RETURN_INVALID_PARAMETER; } + // // Get guid attribute of guid section. // - *SectionAttribute = ((EFI_GUID_DEFINED_SECTION2 *) InputSection)->Attributes; + *SectionAttribute = ((EFI_GUID_DEFINED_SECTION2 *)InputSection)->Attributes; // // Call Tiano GetInfo to get the required size info. // return UefiDecompressGetInfo ( - (UINT8 *) InputSection + ((EFI_GUID_DEFINED_SECTION2 *) InputSection)->DataOffset, - SECTION2_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION2 *) InputSection)->DataOffset, + (UINT8 *)InputSection + ((EFI_GUID_DEFINED_SECTION2 *)InputSection)->DataOffset, + SECTION2_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION2 *)InputSection)->DataOffset, OutputBufferSize, ScratchBufferSize ); } else { if (!CompareGuid ( - &gTianoCustomDecompressGuid, - &(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid))) { + &gTianoCustomDecompressGuid, + &(((EFI_GUID_DEFINED_SECTION *)InputSection)->SectionDefinitionGuid) + )) + { return RETURN_INVALID_PARAMETER; } + // // Get guid attribute of guid section. // - *SectionAttribute = ((EFI_GUID_DEFINED_SECTION *) InputSection)->Attributes; + *SectionAttribute = ((EFI_GUID_DEFINED_SECTION *)InputSection)->Attributes; // // Call Tiano GetInfo to get the required size info. // return UefiDecompressGetInfo ( - (UINT8 *) InputSection + ((EFI_GUID_DEFINED_SECTION *) InputSection)->DataOffset, - SECTION_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION *) InputSection)->DataOffset, + (UINT8 *)InputSection + ((EFI_GUID_DEFINED_SECTION *)InputSection)->DataOffset, + SECTION_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION *)InputSection)->DataOffset, OutputBufferSize, ScratchBufferSize ); @@ -150,8 +156,10 @@ TianoDecompress ( if (IS_SECTION2 (InputSection)) { if (!CompareGuid ( - &gTianoCustomDecompressGuid, - &(((EFI_GUID_DEFINED_SECTION2 *) InputSection)->SectionDefinitionGuid))) { + &gTianoCustomDecompressGuid, + &(((EFI_GUID_DEFINED_SECTION2 *)InputSection)->SectionDefinitionGuid) + )) + { return RETURN_INVALID_PARAMETER; } @@ -164,15 +172,17 @@ TianoDecompress ( // Call Tiano Decompress to get the raw data // return UefiTianoDecompress ( - (UINT8 *) InputSection + ((EFI_GUID_DEFINED_SECTION2 *) InputSection)->DataOffset, + (UINT8 *)InputSection + ((EFI_GUID_DEFINED_SECTION2 *)InputSection)->DataOffset, *OutputBuffer, ScratchBuffer, 2 - ); + ); } else { if (!CompareGuid ( - &gTianoCustomDecompressGuid, - &(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid))) { + &gTianoCustomDecompressGuid, + &(((EFI_GUID_DEFINED_SECTION *)InputSection)->SectionDefinitionGuid) + )) + { return RETURN_INVALID_PARAMETER; } @@ -185,11 +195,11 @@ TianoDecompress ( // Call Tiano Decompress to get the raw data // return UefiTianoDecompress ( - (UINT8 *) InputSection + ((EFI_GUID_DEFINED_SECTION *) InputSection)->DataOffset, + (UINT8 *)InputSection + ((EFI_GUID_DEFINED_SECTION *)InputSection)->DataOffset, *OutputBuffer, ScratchBuffer, 2 - ); + ); } } @@ -203,11 +213,11 @@ RETURN_STATUS EFIAPI TianoDecompressLibConstructor ( VOID -) + ) { return ExtractGuidedSectionRegisterHandlers ( - &gTianoCustomDecompressGuid, - TianoDecompressGetInfo, - TianoDecompress - ); + &gTianoCustomDecompressGuid, + TianoDecompressGetInfo, + TianoDecompress + ); }