From 279fbaffa852881178fb905d3c910b52a4c46e28 Mon Sep 17 00:00:00 2001 From: Sergey Isakov Date: Tue, 28 Apr 2020 10:51:58 +0300 Subject: [PATCH 1/4] use partial string for procedure name Signed-off-by: Sergey Isakov --- rEFIt_UEFI/Platform/AcpiPatcher.cpp | 28 +++++++++++++------------- rEFIt_UEFI/Platform/kernel_patcher.cpp | 4 ++-- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/rEFIt_UEFI/Platform/AcpiPatcher.cpp b/rEFIt_UEFI/Platform/AcpiPatcher.cpp index 476875ecb..f4786ef6b 100644 --- a/rEFIt_UEFI/Platform/AcpiPatcher.cpp +++ b/rEFIt_UEFI/Platform/AcpiPatcher.cpp @@ -296,8 +296,8 @@ void DropTableFromRSDT(UINT32 Signature, UINT64 TableId, UINT32 Length) CHAR8 sign[5], OTID[9]; sign[4] = 0; OTID[8] = 0; - CopyMem(sign, &Signature, 4); - CopyMem(OTID, &TableId, 8); + CopyMem(&sign[0], &Signature, 4); + CopyMem(&OTID[0], &TableId, 8); DBG("Drop tables from RSDT, SIGN=%s TableID=%s Length=%d\n", sign, OTID, (INT32)Length); UINT32 Count = RsdtTableCount(); @@ -310,8 +310,8 @@ void DropTableFromRSDT(UINT32 Signature, UINT64 TableId, UINT32 Length) // skip NULL entry continue; } - CopyMem(&sign, &Table->Signature, 4); - CopyMem(&OTID, &Table->OemTableId, 8); + CopyMem(&sign[0], &Table->Signature, 4); + CopyMem(&OTID[0], &Table->OemTableId, 8); //DBG(" Found table: %s %s\n", sign, OTID); if (!((Signature && Table->Signature == Signature) && (!TableId || Table->OemTableId == TableId) && @@ -337,8 +337,8 @@ void DropTableFromXSDT(UINT32 Signature, UINT64 TableId, UINT32 Length) CHAR8 sign[5], OTID[9]; sign[4] = 0; OTID[8] = 0; - CopyMem(sign, &Signature, 4); - CopyMem(OTID, &TableId, 8); + CopyMem(&sign[0], &Signature, 4); + CopyMem(&OTID[0], &TableId, 8); DBG("Drop tables from XSDT, SIGN=%s TableID=%s Length=%d\n", sign, OTID, (INT32)Length); UINT32 Count = XsdtTableCount(); @@ -351,8 +351,8 @@ void DropTableFromXSDT(UINT32 Signature, UINT64 TableId, UINT32 Length) // skip NULL entry continue; } - CopyMem(&sign, &Table->Signature, 4); - CopyMem(&OTID, &Table->OemTableId, 8); + CopyMem(&sign[0], &Table->Signature, 4); + CopyMem(&OTID[0], &Table->OemTableId, 8); //DBG(" Found table: %s %s\n", sign, OTID); if (!((Signature && Table->Signature == Signature) && (!TableId || Table->OemTableId == TableId) && @@ -925,9 +925,9 @@ VOID DumpChildSsdt(EFI_ACPI_DESCRIPTION_HEADER *TableEntry, CONST CHAR16 *DirNam } // Take Signature and OemId for printing - CopyMem(&Signature, &((EFI_ACPI_DESCRIPTION_HEADER *)adr)->Signature, 4); + CopyMem(&Signature[0], &((EFI_ACPI_DESCRIPTION_HEADER *)adr)->Signature, 4); Signature[4] = 0; - CopyMem(&OemTableId, &((EFI_ACPI_DESCRIPTION_HEADER *)adr)->OemTableId, 8); + CopyMem(&OemTableId[0], &((EFI_ACPI_DESCRIPTION_HEADER *)adr)->OemTableId, 8); OemTableId[8] = 0; stripTrailingSpaces(OemTableId); DBG(" * %llu: '%s', '%s', Rev: %d, Len: %d ", adr, Signature, OemTableId, @@ -1013,9 +1013,9 @@ EFI_STATUS DumpTable(EFI_ACPI_DESCRIPTION_HEADER *TableEntry, CONST CHAR8 *Check BOOLEAN ReleaseFileName = FALSE; // Take Signature and OemId for printing - CopyMem(&Signature, &TableEntry->Signature, 4); + CopyMem(&Signature[0], &TableEntry->Signature, 4); Signature[4] = 0; - CopyMem(&OemTableId, &TableEntry->OemTableId, 8); + CopyMem(&OemTableId[0], &TableEntry->OemTableId, 8); OemTableId[8] = 0; stripTrailingSpaces(OemTableId); @@ -1158,7 +1158,7 @@ EFI_STATUS DumpFadtTables(EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE *Fadt, CONST // Taking it as structure from Acpi 2.0 just to get Version (it's reserved field in Acpi 1.0 and == 0) Facs = (EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE*)(UINTN)FacsAdr; // Take Signature for printing - CopyMem(&Signature, &Facs->Signature, 4); + CopyMem(&Signature[0], &Facs->Signature, 4); Signature[4] = 0; DBG(" %p: '%s', Ver: %d, Len: %d", Facs, Signature, Facs->Version, Facs->Length); @@ -1274,7 +1274,7 @@ VOID DumpTables(VOID *RsdPtrVoid, CHAR16 *DirName) // Take Signature for printing CHAR8 Signature[9]; - CopyMem(&Signature, &RsdPtr->Signature, 8); + CopyMem(&Signature[0], &RsdPtr->Signature, 8); Signature[8] = 0; // Take Rsdt and Xsdt diff --git a/rEFIt_UEFI/Platform/kernel_patcher.cpp b/rEFIt_UEFI/Platform/kernel_patcher.cpp index 9351392ad..9837e43eb 100644 --- a/rEFIt_UEFI/Platform/kernel_patcher.cpp +++ b/rEFIt_UEFI/Platform/kernel_patcher.cpp @@ -102,12 +102,12 @@ UINTN searchProc(unsigned char * kernel, UINTN kernelSize, const char *procedure const char* Names = (const char*)(&kernel[LinkSeg->AddrNames]); VTABLE * vArray = (VTABLE*)(&kernel[AddrVtable]); //search for the name - UINTN nameLen = strlen(procedure); +// UINTN nameLen = strlen(procedure); size_t i; bool found = false; for (i=0; i Date: Tue, 28 Apr 2020 13:49:24 +0300 Subject: [PATCH 2/4] fix some addresses issue, format text Signed-off-by: SergeySlice --- CloverEFI/BiosKeyboard/BiosKeyboard.c | 4 +- .../GraphicsConsoleDxe/GraphicsConsole.c | 10 +- CloverEFI/OsxAcpiPlatformDxe/AcpiPlatform.c | 2 +- CloverEFI/OsxAcpiTableDxe/AcpiTable.c | 2 +- CloverEFI/OsxBdsDxe/BootMaint/BmLib.c | 10 +- CloverEFI/OsxBdsDxe/BootMaint/BootMaint.c | 12 +-- CloverEFI/OsxBdsDxe/BootMaint/BootOption.c | 36 +++---- CloverEFI/OsxBdsDxe/BootMaint/UpdatePage.c | 2 +- CloverEFI/OsxBdsDxe/BootMaint/Variable.c | 24 ++--- CloverEFI/OsxBdsDxe/BootMngr/BootManager.c | 2 +- CloverEFI/OsxBdsDxe/Capsules.c | 6 +- .../OsxBdsDxe/DeviceMngr/DeviceManager.c | 14 +-- CloverEFI/OsxBdsDxe/FrontPage.c | 10 +- CloverEFI/OsxBdsDxe/Hotkey.c | 4 +- CloverEFI/OsxBdsDxe/Language.c | 2 +- CloverEFI/OsxDxeCore/Dispatcher/Dispatcher.c | 4 +- CloverEFI/OsxDxeCore/Event/Event.c | 2 +- CloverEFI/OsxDxeCore/FwVol/FwVol.c | 2 +- CloverEFI/OsxDxeCore/Gcd/Gcd.c | 4 +- CloverEFI/OsxDxeCore/Hand/Handle.c | 4 +- CloverEFI/OsxDxeCore/Image/Image.c | 2 +- CloverEFI/OsxDxeCore/Misc/DebugImageInfo.c | 4 +- .../SectionExtraction/CoreSectionExtraction.c | 2 +- CloverEFI/OsxPciBusNoEnumerationDxe/PciIo.c | 2 +- CloverEFI/OsxSmbiosGenDxe/SmbiosGen.c | 6 +- CloverEFI/PciRootBridgeDxe/DeviceIo.c | 2 +- .../CpuExceptionCommon.c | 4 +- .../CpuExceptionHandlerLib/DxeException.c | 4 +- Drivers/AtaAtapi/AtaAtapiPassThru.c | 4 +- Drivers/AtaBus/AtaBus.c | 2 +- Drivers/AtaBus/AtaPassThruExecute.c | 8 +- Drivers/DVDBus/ScsiBus.c | 2 +- Drivers/DVDDisk/ScsiDisk.c | 4 +- Drivers/Isa/IsaBusDxe/IsaBus.c | 2 +- Drivers/Isa/Ps2KeyboardDxe/Ps2KbdTextIn.c | 2 +- Drivers/Isa/Ps2KeyboardDxe/Ps2Keyboard.c | 2 +- .../Ps2MouseAbsolutePointer.c | 2 +- Drivers/Isa/Ps2MouseDxe/Ps2Mouse.c | 2 +- Drivers/OhciDxe/Ohci.c | 2 +- Drivers/PartitionDxe/Gpt.c | 10 +- Drivers/PartitionDxe/Partition.c | 2 +- Drivers/SataControllerDxe/SataController.c | 16 +-- Drivers/UsbBusDxe/UsbBus.c | 8 +- Drivers/UsbBusDxe/UsbDesc.c | 16 +-- Drivers/UsbBusDxe/UsbEnumer.c | 4 +- Drivers/UsbBusDxe/UsbHub.c | 2 +- Drivers/UsbBusDxe/UsbUtility.c | 4 +- Drivers/UsbKbDxe/EfiKey.c | 4 +- Drivers/UsbKbDxe/KeyBoard.c | 6 +- Drivers/UsbMouseDxe/UsbMouse.c | 6 +- Drivers/XhciDxe/UsbHcMem.c | 4 +- Drivers/XhciDxe/Xhci.c | 8 +- Drivers/XhciDxe/XhciSched.c | 14 +-- .../ApfsDriverLoader/ApfsDriverLoader.c | 10 +- .../FatPkg/EnhancedFatDxe/DirectoryCache.c | 2 +- .../FatPkg/EnhancedFatDxe/DirectoryManage.c | 6 +- FileSystems/FatPkg/EnhancedFatDxe/DiskCache.c | 2 +- FileSystems/FatPkg/EnhancedFatDxe/Init.c | 2 +- FileSystems/FatPkg/EnhancedFatDxe/Misc.c | 4 +- FileSystems/FatPkg/EnhancedFatDxe/Open.c | 2 +- FileSystems/FatPkg/EnhancedFatDxe/ReadWrite.c | 2 +- LegacyBios/KeyboardDxe/BiosKeyboard.c | 4 +- LegacyBios/VideoDxe/BiosVideo.c | 2 +- LegacyBios/VideoDxe/BiosVideo2.c | 2 +- Library/DeviceTreeLib/DeviceTreeLib.c | 2 +- Library/GenericBdsLib/BdsBoot.c | 14 +-- Library/GenericBdsLib/BdsConsole.c | 2 +- Library/GenericBdsLib/BdsMisc.c | 12 +-- Library/GenericBdsLib/DevicePath.c | 4 +- Library/GenericBdsLib/Performance.c | 2 +- Library/MachoLib/CxxSymbols.c | 8 +- Library/MemLogLibDefault/MemLogLib.c | 4 +- Library/OcGuardLib/Ubsan.h | 4 +- .../BootManagerMenuApp/BootManagerMenu.c | 6 +- .../Application/CapsuleApp/AppSupport.c | 2 +- .../Application/CapsuleApp/CapsuleDump.c | 6 +- .../MemoryProfileInfo/MemoryProfileInfo.c | 8 +- .../SmiHandlerProfileInfo.c | 2 +- MdeModulePkg/Application/UiApp/FrontPage.c | 10 +- .../UiApp/FrontPageCustomizedUiSupport.c | 6 +- MdeModulePkg/Bus/Ata/AhciPei/AhciMode.c | 2 +- MdeModulePkg/Bus/Ata/AhciPei/AhciPei.c | 2 +- .../Ata/AtaAtapiPassThru/AtaAtapiPassThru.c | 4 +- MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.c | 2 +- .../Bus/Ata/AtaBusDxe/AtaPassThruExecute.c | 8 +- MdeModulePkg/Bus/I2c/I2cDxe/I2cBus.c | 2 +- MdeModulePkg/Bus/I2c/I2cDxe/I2cHost.c | 6 +- .../Bus/Isa/Ps2KeyboardDxe/Ps2KbdTextIn.c | 2 +- .../Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.c | 2 +- MdeModulePkg/Bus/Isa/Ps2MouseDxe/Ps2Mouse.c | 2 +- MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c | 2 +- MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c | 2 +- MdeModulePkg/Bus/Pci/EhciDxe/EhciUrb.c | 2 +- MdeModulePkg/Bus/Pci/EhciDxe/UsbHcMem.c | 4 +- .../IncompatiblePciDeviceSupport.c | 2 +- .../NonDiscoverablePciDeviceDxe.c | 2 +- .../Bus/Pci/NvmExpressDxe/NvmExpress.c | 2 +- .../Bus/Pci/NvmExpressDxe/NvmExpressBlockIo.c | 20 ++-- .../Bus/Pci/NvmExpressDxe/NvmExpressHci.c | 2 +- .../Pci/NvmExpressDxe/NvmExpressPassthru.c | 8 +- .../Bus/Pci/NvmExpressPei/NvmExpressPei.c | 6 +- .../Bus/Pci/NvmExpressPei/NvmExpressPeiHci.c | 2 +- .../Bus/Pci/PciBusDxe/PciDeviceSupport.c | 2 +- .../Bus/Pci/PciBusDxe/PciDriverOverride.c | 2 +- .../Bus/Pci/PciBusDxe/PciEnumerator.c | 4 +- .../Bus/Pci/PciBusDxe/PciEnumeratorSupport.c | 2 +- .../Bus/Pci/PciBusDxe/PciHotPlugSupport.c | 2 +- MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c | 2 +- .../Bus/Pci/PciBusDxe/PciResourceSupport.c | 2 +- .../Bus/Pci/PciHostBridgeDxe/PciHostBridge.c | 4 +- .../Pci/PciHostBridgeDxe/PciRootBridgeIo.c | 2 +- .../Pci/SataControllerDxe/SataController.c | 10 +- .../Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c | 2 +- .../Bus/Pci/SdMmcPciHcPei/SdMmcPciHcPei.c | 2 +- .../Bus/Pci/UfsPciHcPei/UfsPciHcPei.c | 2 +- MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c | 2 +- MdeModulePkg/Bus/Pci/UhciDxe/UhciSched.c | 2 +- MdeModulePkg/Bus/Pci/UhciDxe/UsbHcMem.c | 4 +- MdeModulePkg/Bus/Pci/XhciDxe/UsbHcMem.c | 4 +- MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c | 6 +- MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c | 16 +-- MdeModulePkg/Bus/Pci/XhciPei/XhcPeim.c | 4 +- MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c | 20 ++-- MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c | 2 +- MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c | 30 +++--- MdeModulePkg/Bus/Sd/EmmcBlockIoPei/EmmcHci.c | 2 +- MdeModulePkg/Bus/Sd/EmmcDxe/EmmcBlockIo.c | 16 +-- MdeModulePkg/Bus/Sd/EmmcDxe/EmmcDxe.c | 2 +- MdeModulePkg/Bus/Sd/SdBlockIoPei/SdHci.c | 2 +- MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c | 10 +- MdeModulePkg/Bus/Sd/SdDxe/SdDxe.c | 2 +- .../Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c | 2 +- MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c | 8 +- MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.c | 16 +-- MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c | 4 +- MdeModulePkg/Bus/Usb/UsbBusDxe/UsbHub.c | 2 +- MdeModulePkg/Bus/Usb/UsbBusDxe/UsbUtility.c | 4 +- MdeModulePkg/Bus/Usb/UsbKbDxe/EfiKey.c | 4 +- MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c | 6 +- .../Bus/Usb/UsbMassStorageDxe/UsbMassBot.c | 2 +- .../Bus/Usb/UsbMassStorageDxe/UsbMassCbi.c | 2 +- .../Bus/Usb/UsbMassStorageDxe/UsbMassImpl.c | 4 +- .../UsbMouseAbsolutePointer.c | 6 +- MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouse.c | 6 +- MdeModulePkg/Core/Dxe/Dispatcher/Dispatcher.c | 4 +- MdeModulePkg/Core/Dxe/Event/Event.c | 2 +- MdeModulePkg/Core/Dxe/FwVol/FwVol.c | 2 +- MdeModulePkg/Core/Dxe/Gcd/Gcd.c | 4 +- MdeModulePkg/Core/Dxe/Hand/DriverSupport.c | 2 +- MdeModulePkg/Core/Dxe/Hand/Handle.c | 4 +- MdeModulePkg/Core/Dxe/Image/Image.c | 4 +- MdeModulePkg/Core/Dxe/Misc/DebugImageInfo.c | 4 +- MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c | 2 +- .../SectionExtraction/CoreSectionExtraction.c | 2 +- MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c | 4 +- MdeModulePkg/Core/Pei/FwVol/FwVol.c | 8 +- MdeModulePkg/Core/Pei/PeiMain/PeiMain.c | 2 +- MdeModulePkg/Core/Pei/Ppi/Ppi.c | 6 +- MdeModulePkg/Core/PiSmmCore/Dispatcher.c | 2 +- MdeModulePkg/Core/PiSmmCore/Handle.c | 4 +- MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c | 4 +- MdeModulePkg/Core/PiSmmCore/Smi.c | 2 +- .../Core/PiSmmCore/SmiHandlerProfile.c | 4 +- .../Library/BaseBmpSupportLib/BmpSupportLib.c | 2 +- .../BaseMemoryAllocationLibNull.c | 2 +- .../BootMaintenance.c | 6 +- ...ootMaintenanceManagerCustomizedUiSupport.c | 2 +- .../BootMaintenanceManagerUiLib/BootOption.c | 20 ++-- .../BootMaintenanceManagerUiLib/UpdatePage.c | 2 +- .../BootMaintenanceManagerUiLib/Variable.c | 14 +-- .../Library/BootManagerUiLib/BootManager.c | 6 +- .../CustomizedDisplayLib.c | 2 +- .../CustomizedDisplayLibInternal.c | 8 +- .../DeviceManagerUiLib/DeviceManager.c | 2 +- .../Library/DxeCapsuleLibFmp/CapsuleOnDisk.c | 8 +- .../Library/DxeCapsuleLibFmp/DxeCapsuleLib.c | 10 +- .../DxeCapsuleLibFmp/DxeCapsuleProcessLib.c | 12 +-- .../DxeCapsuleLibFmp/DxeCapsuleReportLib.c | 2 +- .../MemoryAllocationLib.c | 12 +-- .../DxeCorePerformanceLib.c | 14 +-- MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c | 16 +-- MdeModulePkg/Library/DxeNetLib/DxeNetLib.c | 4 +- MdeModulePkg/Library/DxeNetLib/NetBuffer.c | 4 +- .../ReportStatusCodeLib.c | 2 +- .../Library/FileExplorerLib/FileExplorer.c | 16 +-- .../NonDiscoverableDeviceRegistrationLib.c | 2 +- .../PeiPerformanceLib/PeiPerformanceLib.c | 8 +- .../ReportStatusCodeLib.c | 2 +- .../PiDxeS3BootScriptLib/BootScriptSave.c | 2 +- .../MemoryAllocationLib.c | 10 +- .../PlatformVarCleanupLib/PlatVarCleanupLib.c | 16 +-- .../ReportStatusCodeLib.c | 2 +- .../SmmCorePerformanceLib.c | 14 +-- .../MemoryAllocationLib.c | 10 +- .../ReportStatusCodeLib.c | 2 +- .../UefiBootManagerLib/BmBootDescription.c | 10 +- .../Library/UefiBootManagerLib/BmHotkey.c | 2 +- .../Library/UefiBootManagerLib/BmLoadOption.c | 2 +- MdeModulePkg/Library/UefiHiiLib/HiiLanguage.c | 2 +- MdeModulePkg/Library/UefiHiiLib/HiiLib.c | 34 +++--- MdeModulePkg/Library/UefiHiiLib/HiiString.c | 4 +- .../MemoryAllocationLib.c | 12 +-- .../Library/VarCheckHiiLib/VarCheckHiiGen.c | 22 ++-- .../Library/VarCheckHiiLib/VarCheckHiiGen.h | 2 +- .../VarCheckHiiLib/VarCheckHiiGenFromFv.c | 6 +- .../Universal/Acpi/AcpiTableDxe/AcpiTable.c | 2 +- MdeModulePkg/Universal/BdsDxe/Language.c | 2 +- .../Universal/CapsulePei/UefiCapsule.c | 6 +- .../Console/ConSplitterDxe/ConSplitter.c | 14 +-- .../GraphicsConsoleDxe/GraphicsConsole.c | 10 +- .../Universal/Console/TerminalDxe/Terminal.c | 8 +- .../Console/TerminalDxe/TerminalConIn.c | 2 +- .../DebugSupportDxe/Ia32/PlDebugSupport.c | 2 +- .../Universal/Disk/DiskIoDxe/DiskIo.c | 2 +- .../Universal/Disk/PartitionDxe/Gpt.c | 10 +- .../Universal/Disk/PartitionDxe/Partition.c | 2 +- .../Universal/Disk/PartitionDxe/Udf.c | 4 +- .../Disk/RamDiskDxe/RamDiskFileExplorer.c | 2 +- .../Disk/RamDiskDxe/RamDiskProtocol.c | 6 +- MdeModulePkg/Universal/Disk/UdfDxe/File.c | 4 +- .../Disk/UdfDxe/FileSystemOperations.c | 4 +- MdeModulePkg/Universal/Disk/UdfDxe/Udf.c | 2 +- .../Universal/DisplayEngineDxe/FormDisplay.c | 8 +- .../Universal/DisplayEngineDxe/InputHandler.c | 10 +- .../Universal/DisplayEngineDxe/Popup.c | 6 +- .../DisplayEngineDxe/ProcessOptions.c | 24 ++--- .../Universal/DriverSampleDxe/DriverSample.c | 18 ++-- .../Universal/EbcDxe/EbcDebugger/EdbHook.c | 6 +- .../EbcDxe/EbcDebugger/EdbSupportFile.c | 6 +- .../EbcDxe/EbcDebugger/EdbSupportString.c | 2 +- .../Universal/EbcDxe/EbcDebugger/EdbSymbol.c | 10 +- MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c | 6 +- .../FaultTolerantWriteSmmDxe.c | 2 +- .../Universal/FaultTolerantWriteDxe/FtwMisc.c | 2 +- .../UpdateWorkingBlock.c | 2 +- .../FvSimpleFileSystem.c | 6 +- .../FvSimpleFileSystemEntryPoint.c | 12 +-- .../HiiDatabaseDxe/ConfigKeywordHandler.c | 22 ++-- .../Universal/HiiDatabaseDxe/ConfigRouting.c | 84 +++++++-------- .../Universal/HiiDatabaseDxe/Database.c | 64 +++++------ MdeModulePkg/Universal/HiiDatabaseDxe/Font.c | 44 ++++---- MdeModulePkg/Universal/HiiDatabaseDxe/Image.c | 22 ++-- .../Universal/HiiDatabaseDxe/String.c | 34 +++--- .../Universal/LoadFileOnFv2/LoadFileOnFv2.c | 4 +- .../GenericMemoryTestDxe/LightMemoryTest.c | 4 +- MdeModulePkg/Universal/PCD/Dxe/Pcd.c | 2 +- MdeModulePkg/Universal/PCD/Dxe/Service.c | 10 +- MdeModulePkg/Universal/PCD/Pei/Service.c | 2 +- .../PlatDriOverrideDxe.c | 22 ++-- .../PlatDriOverrideLib.c | 14 +-- .../RegularExpressionDxe.c | 2 +- .../Universal/SetupBrowserDxe/Expression.c | 10 +- .../Universal/SetupBrowserDxe/IfrParse.c | 50 ++++----- .../Universal/SetupBrowserDxe/Presentation.c | 14 +-- .../Universal/SetupBrowserDxe/Setup.c | 40 +++---- MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.c | 6 +- .../Smm/MemoryStatusCodeWorker.c | 2 +- .../Variable/RuntimeDxe/Measurement.c | 2 +- .../Universal/Variable/RuntimeDxe/Variable.c | 12 +-- .../RuntimeDxe/VariableSmmRuntimeDxe.c | 2 +- MdePkg/Include/Library/BaseLib.h | 6 +- MdePkg/Include/Library/MemoryAllocationLib.h | 2 +- .../Library/BaseDebugLibSerialPort/DebugLib.c | 4 +- MdePkg/Library/BaseLib/SafeString.c | 2 +- MdePkg/Library/BaseLib/String.c | 18 ++-- MdePkg/Library/DxeHstiLib/HstiAip.c | 2 +- MdePkg/Library/DxeHstiLib/HstiDxe.c | 2 +- .../DxeRuntimeDebugLibSerialPort/DebugLib.c | 4 +- .../Library/DxeServicesLib/DxeServicesLib.c | 2 +- .../MemoryAllocationLib.c | 10 +- .../Library/PeiServicesLib/PeiServicesLib.c | 4 +- MdePkg/Library/SmmMemLib/SmmMemLib.c | 2 +- .../MemoryAllocationLib.c | 10 +- .../SmmPeriodicSmiLib/SmmPeriodicSmiLib.c | 2 +- .../UefiDebugLibDebugPortProtocol/DebugLib.c | 4 +- .../UefiDevicePathLib/DevicePathToText.c | 6 +- .../UefiDevicePathLib/DevicePathUtilities.c | 2 +- .../UefiFileHandleLib/UefiFileHandleLib.c | 2 +- MdePkg/Library/UefiLib/Console.c | 4 +- MdePkg/Library/UefiLib/UefiLib.c | 4 +- MdePkg/Library/UefiLib/UefiLibPrint.c | 4 +- .../MemoryAllocationLib.c | 12 +-- MdePkg/Library/UefiScsiLib/UefiScsiLib.c | 16 +-- MemoryFix/AptioMemoryFix/BootArgs.c | 2 +- MemoryFix/AptioMemoryFix/CustomSlide.c | 2 +- .../AppleKeyAggregator/AppleKeyAggregator.c | 4 +- Protocols/DataHubDxe/DataHub.c | 2 +- Protocols/EmuVariableUefi/EmuVariable.c | 12 +-- Protocols/EmuVariableUefi/InitVariable.c | 4 +- rEFIt_UEFI/Platform/AmlGenerator.cpp | 26 ++--- rEFIt_UEFI/Platform/BootOptions.cpp | 8 +- rEFIt_UEFI/Platform/DevicePath.cpp | 4 +- rEFIt_UEFI/Platform/Nvram.cpp | 30 +++--- rEFIt_UEFI/Platform/Nvram.h | 2 +- rEFIt_UEFI/Platform/Posix/strlen.cpp | 2 +- rEFIt_UEFI/Platform/Settings.cpp | 100 +++++++++--------- rEFIt_UEFI/Platform/kernel_patcher.cpp | 3 + rEFIt_UEFI/Platform/platformdata.cpp | 6 +- rEFIt_UEFI/libeg/BmLib.cpp | 10 +- rEFIt_UEFI/libeg/BmLib.h | 2 +- rEFIt_UEFI/refit/IO.cpp | 4 +- rEFIt_UEFI/refit/lib.cpp | 2 +- rEFIt_UEFI/refit/list.cpp | 2 +- 303 files changed, 1091 insertions(+), 1088 deletions(-) diff --git a/CloverEFI/BiosKeyboard/BiosKeyboard.c b/CloverEFI/BiosKeyboard/BiosKeyboard.c index 1cf080615..f386fd3cf 100644 --- a/CloverEFI/BiosKeyboard/BiosKeyboard.c +++ b/CloverEFI/BiosKeyboard/BiosKeyboard.c @@ -323,7 +323,7 @@ BiosKeyboardDriverBindingStart ( // // Allocate the private device structure // - BiosKeyboardPrivate = (BIOS_KEYBOARD_DEV *) AllocateZeroPool (sizeof (BIOS_KEYBOARD_DEV)); + BiosKeyboardPrivate = (BIOS_KEYBOARD_DEV *) AllocateZeroPool(sizeof (BIOS_KEYBOARD_DEV)); if (NULL == BiosKeyboardPrivate) { Status = EFI_OUT_OF_RESOURCES; goto Done; @@ -2699,7 +2699,7 @@ BiosKeyboardRegisterKeyNotify ( // Allocate resource to save the notification function // - NewNotify = (BIOS_KEYBOARD_CONSOLE_IN_EX_NOTIFY *) AllocateZeroPool (sizeof (BIOS_KEYBOARD_CONSOLE_IN_EX_NOTIFY)); + NewNotify = (BIOS_KEYBOARD_CONSOLE_IN_EX_NOTIFY *) AllocateZeroPool(sizeof (BIOS_KEYBOARD_CONSOLE_IN_EX_NOTIFY)); if (NewNotify == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Exit; diff --git a/CloverEFI/GraphicsConsoleDxe/GraphicsConsole.c b/CloverEFI/GraphicsConsoleDxe/GraphicsConsole.c index c11a3b3b9..c0d8c6f49 100644 --- a/CloverEFI/GraphicsConsoleDxe/GraphicsConsole.c +++ b/CloverEFI/GraphicsConsoleDxe/GraphicsConsole.c @@ -281,7 +281,7 @@ InitializeGraphicsConsoleTextMode ( // and does not include the invalid modes which exceed the max column and row. // Reserve 2 modes for 80x25, 80x50 of graphics console. // - NewModeBuffer = AllocateZeroPool (sizeof (GRAPHICS_CONSOLE_MODE_DATA) * (Count + 2)); + NewModeBuffer = AllocateZeroPool(sizeof (GRAPHICS_CONSOLE_MODE_DATA) * (Count + 2)); if (!NewModeBuffer) { return EFI_OUT_OF_RESOURCES; } @@ -1783,7 +1783,7 @@ DrawUnicodeWeightAtCursorN ( UINTN RowInfoArraySize; Private = GRAPHICS_CONSOLE_CON_OUT_DEV_FROM_THIS (This); - Blt = (EFI_IMAGE_OUTPUT *) AllocateZeroPool (sizeof (EFI_IMAGE_OUTPUT)); + Blt = (EFI_IMAGE_OUTPUT *) AllocateZeroPool(sizeof (EFI_IMAGE_OUTPUT)); if (Blt == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -1801,7 +1801,7 @@ DrawUnicodeWeightAtCursorN ( // *(String + Count) = L'\0'; - FontInfo = (EFI_FONT_DISPLAY_INFO *) AllocateZeroPool (sizeof (EFI_FONT_DISPLAY_INFO)); + FontInfo = (EFI_FONT_DISPLAY_INFO *) AllocateZeroPool(sizeof (EFI_FONT_DISPLAY_INFO)); if (FontInfo == NULL) { FreePool(Blt); FreePool(String); @@ -1840,7 +1840,7 @@ DrawUnicodeWeightAtCursorN ( UgaDraw = Private->UgaDraw; - Blt->Image.Bitmap = AllocateZeroPool (Blt->Width * Blt->Height * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)); + Blt->Image.Bitmap = AllocateZeroPool(Blt->Width * Blt->Height * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)); if (Blt->Image.Bitmap == NULL) { FreePool(Blt); FreePool(String); @@ -2074,7 +2074,7 @@ RegisterFontPackage ( // +--------------------------------+ PackageLength = sizeof (EFI_HII_SIMPLE_FONT_PACKAGE_HDR) + mNarrowFontSize + 4; - Package = AllocateZeroPool (PackageLength); + Package = AllocateZeroPool(PackageLength); // ASSERT (Package != NULL); if (!Package) { return; diff --git a/CloverEFI/OsxAcpiPlatformDxe/AcpiPlatform.c b/CloverEFI/OsxAcpiPlatformDxe/AcpiPlatform.c index b781ea1f0..7ce9ce60a 100644 --- a/CloverEFI/OsxAcpiPlatformDxe/AcpiPlatform.c +++ b/CloverEFI/OsxAcpiPlatformDxe/AcpiPlatform.c @@ -505,7 +505,7 @@ AcpiPlatformEntryPoint ( EFI_FILE_SYSTEM_INFO **mFsInfo = NULL; gBS->LocateHandleBuffer (ByProtocol, &gEfiSimpleFileSystemProtocolGuid, NULL, &mFsCount, &mFs); - mFsInfo = AllocateZeroPool (mFsCount * sizeof (EFI_FILE_SYSTEM_INFO *)); + mFsInfo = AllocateZeroPool(mFsCount * sizeof (EFI_FILE_SYSTEM_INFO *)); if (mFsInfo == NULL) { // If we can't do this then we can't support file system entries mFsCount = 0; diff --git a/CloverEFI/OsxAcpiTableDxe/AcpiTable.c b/CloverEFI/OsxAcpiTableDxe/AcpiTable.c index 3eef42ebf..c95ced8c9 100644 --- a/CloverEFI/OsxAcpiTableDxe/AcpiTable.c +++ b/CloverEFI/OsxAcpiTableDxe/AcpiTable.c @@ -49,7 +49,7 @@ InitializeAcpiTableDxe ( // // Initialize our protocol // - PrivateData = AllocateZeroPool (sizeof (EFI_ACPI_TABLE_INSTANCE)); + PrivateData = AllocateZeroPool(sizeof (EFI_ACPI_TABLE_INSTANCE)); // ASSERT (PrivateData); if (!PrivateData) { return EFI_OUT_OF_RESOURCES; diff --git a/CloverEFI/OsxBdsDxe/BootMaint/BmLib.c b/CloverEFI/OsxBdsDxe/BootMaint/BmLib.c index 713c90ef0..badfad785 100644 --- a/CloverEFI/OsxBdsDxe/BootMaint/BmLib.c +++ b/CloverEFI/OsxBdsDxe/BootMaint/BmLib.c @@ -99,7 +99,7 @@ EfiGrowBuffer ( FreePool(*Buffer); } - *Buffer = AllocateZeroPool (BufferSize); + *Buffer = AllocateZeroPool(BufferSize); if (*Buffer != NULL) { TryAgain = TRUE; @@ -234,7 +234,7 @@ EfiLibFileSystemVolumeLabelInfo ( if (Status == EFI_BUFFER_TOO_SMALL) { // inc size by 2 because some drivers (HFSPlus.efi) do not count 0 at the end of file name Size += 2; - VolumeInfo = AllocateZeroPool (Size); + VolumeInfo = AllocateZeroPool(Size); Status = FHand->GetInfo (FHand, &gEfiFileSystemVolumeLabelInfoIdGuid, &Size, VolumeInfo); // Check to make sure this isn't actually EFI_FILE_SYSTEM_INFO if (!EFI_ERROR(Status)) @@ -334,7 +334,7 @@ EfiLibFileInfo ( if (Status == EFI_BUFFER_TOO_SMALL) { // inc size by 2 because some drivers (HFSPlus.efi) do not count 0 at the end of file name Size += 2; - FileInfo = AllocateZeroPool (Size); + FileInfo = AllocateZeroPool(Size); Status = FHand->GetInfo (FHand, &gEfiFileInfoGuid, &Size, FileInfo); } @@ -358,7 +358,7 @@ EfiLibFileSystemInfo ( if (Status == EFI_BUFFER_TOO_SMALL) { // inc size by 2 because some drivers (HFSPlus.efi) do not count 0 at the end of file name Size += 2; - FileSystemInfo = AllocateZeroPool (Size); + FileSystemInfo = AllocateZeroPool(Size); Status = FHand->GetInfo (FHand, &gEfiFileSystemInfoGuid, &Size, FileSystemInfo); } @@ -415,7 +415,7 @@ EfiReallocatePool ( NewPool = NULL; if (NewSize != 0) { - NewPool = AllocateZeroPool (NewSize); + NewPool = AllocateZeroPool(NewSize); } if (OldPool != NULL) { diff --git a/CloverEFI/OsxBdsDxe/BootMaint/BootMaint.c b/CloverEFI/OsxBdsDxe/BootMaint/BootMaint.c index a8203d1a5..f80d6298d 100644 --- a/CloverEFI/OsxBdsDxe/BootMaint/BootMaint.c +++ b/CloverEFI/OsxBdsDxe/BootMaint/BootMaint.c @@ -288,7 +288,7 @@ BootMaintExtractConfig ( // EFI_STRING ConfigRequestHdr = HiiConstructConfigHdr (&gBootMaintFormSetGuid, mBootMaintStorageName, Private->BmmDriverHandle); Size = (StrLen (ConfigRequestHdr) + 32 + 1) * sizeof (CHAR16); - ConfigRequest = AllocateZeroPool (Size); + ConfigRequest = AllocateZeroPool(Size); // ASSERT (ConfigRequest != NULL); if (!ConfigRequest) { return EFI_OUT_OF_RESOURCES; @@ -1177,7 +1177,7 @@ InitializeBM ( // // Allocate the storage for the entire Package List // - PackageListHeader = AllocateZeroPool (Length); + PackageListHeader = AllocateZeroPool(Length); // // If the Package List can not be allocated, then return a NULL HII Handle @@ -1341,7 +1341,7 @@ InitializeStringDepository ( ) { STRING_DEPOSITORY *StringDepository; - StringDepository = AllocateZeroPool (sizeof (STRING_DEPOSITORY) * STRING_DEPOSITORY_NUMBER); + StringDepository = AllocateZeroPool(sizeof (STRING_DEPOSITORY) * STRING_DEPOSITORY_NUMBER); FileOptionStrDepository = StringDepository++; // ConsoleOptionStrDepository = StringDepository++; BootOptionStrDepository = StringDepository++; @@ -1380,7 +1380,7 @@ GetStringTokenFromDepository ( // // If there is no usable node in the list, update the list. // - NextListNode = AllocateZeroPool (sizeof (STRING_LIST_NODE)); + NextListNode = AllocateZeroPool(sizeof (STRING_LIST_NODE)); ASSERT (NextListNode != NULL); NextListNode->StringToken = HiiSetString (CallbackData->BmmHiiHandle, 0, L" ", NULL); ASSERT (NextListNode->StringToken != 0); @@ -1580,7 +1580,7 @@ InitBMPackage ( // // Create CallbackData structures for Driver Callback // - BmmCallbackInfo = AllocateZeroPool (sizeof (BMM_CALLBACK_DATA)); + BmmCallbackInfo = AllocateZeroPool(sizeof (BMM_CALLBACK_DATA)); if (BmmCallbackInfo == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -1588,7 +1588,7 @@ InitBMPackage ( // // Create LoadOption in BmmCallbackInfo for Driver Callback // - Ptr = AllocateZeroPool (sizeof (BM_LOAD_CONTEXT) + sizeof (BM_FILE_CONTEXT) + sizeof (BM_HANDLE_CONTEXT) + sizeof (BM_MENU_ENTRY)); + Ptr = AllocateZeroPool(sizeof (BM_LOAD_CONTEXT) + sizeof (BM_FILE_CONTEXT) + sizeof (BM_HANDLE_CONTEXT) + sizeof (BM_MENU_ENTRY)); if (Ptr == NULL) { FreePool(BmmCallbackInfo); BmmCallbackInfo = NULL; diff --git a/CloverEFI/OsxBdsDxe/BootMaint/BootOption.c b/CloverEFI/OsxBdsDxe/BootMaint/BootOption.c index 0b14e2344..e29627837 100644 --- a/CloverEFI/OsxBdsDxe/BootMaint/BootOption.c +++ b/CloverEFI/OsxBdsDxe/BootMaint/BootOption.c @@ -76,12 +76,12 @@ BOpt_CreateMenuEntry ( // // Create new menu entry // - MenuEntry = AllocateZeroPool (sizeof (BM_MENU_ENTRY)); + MenuEntry = AllocateZeroPool(sizeof (BM_MENU_ENTRY)); if (MenuEntry == NULL) { return NULL; } - MenuEntry->VariableContext = AllocateZeroPool (ContextSize); + MenuEntry->VariableContext = AllocateZeroPool(ContextSize); if (MenuEntry->VariableContext == NULL) { FreePool(MenuEntry); return NULL; @@ -283,7 +283,7 @@ BOpt_FindFileSystem ( // Issue a dummy read to trigger reinstall of BlockIo protocol for removable media // if (BlkIo->Media->RemovableMedia) { - Buffer = AllocateZeroPool (BlkIo->Media->BlockSize); + Buffer = AllocateZeroPool(BlkIo->Media->BlockSize); if (NULL == Buffer) { FreePool(BlkIoHandle); return EFI_OUT_OF_RESOURCES; @@ -389,7 +389,7 @@ BOpt_FindFileSystem ( } TempStr = MenuEntry->HelpString; - MenuEntry->DisplayString = AllocateZeroPool (MAX_CHAR); + MenuEntry->DisplayString = AllocateZeroPool(MAX_CHAR); ASSERT (MenuEntry->DisplayString != NULL); UnicodeSPrint ( MenuEntry->DisplayString, @@ -437,7 +437,7 @@ BOpt_FindFileSystem ( MenuEntry->HelpString = FileDevicePathToStr (FileContext->DevicePath); TempStr = MenuEntry->HelpString; - MenuEntry->DisplayString = AllocateZeroPool (MAX_CHAR); + MenuEntry->DisplayString = AllocateZeroPool(MAX_CHAR); ASSERT (MenuEntry->DisplayString != NULL); UnicodeSPrint ( MenuEntry->DisplayString, @@ -496,7 +496,7 @@ BOpt_FindFileSystem ( MenuEntry->HelpString = FileDevicePathToStr (FileContext->DevicePath); TempStr = MenuEntry->HelpString; - MenuEntry->DisplayString = AllocateZeroPool (MAX_CHAR); + MenuEntry->DisplayString = AllocateZeroPool(MAX_CHAR); ASSERT (MenuEntry->DisplayString != NULL); UnicodeSPrint ( MenuEntry->DisplayString, @@ -606,7 +606,7 @@ BOpt_FindFiles ( ); DirBufferSize = sizeof (EFI_FILE_INFO) + 1024; - DirInfo = AllocateZeroPool (DirBufferSize); + DirInfo = AllocateZeroPool(DirBufferSize); if (DirInfo == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -668,7 +668,7 @@ BOpt_FindFiles ( if (NewFileContext->IsDir) { BufferSize = StrLen (DirInfo->FileName) * 2 + 6; - NewMenuEntry->DisplayString = AllocateZeroPool (BufferSize); + NewMenuEntry->DisplayString = AllocateZeroPool(BufferSize); UnicodeSPrint ( NewMenuEntry->DisplayString, @@ -936,7 +936,7 @@ BOpt_GetBootOptions ( continue; } - LoadOption = AllocateZeroPool (BootOptionSize); + LoadOption = AllocateZeroPool(BootOptionSize); if (LoadOption == NULL) { continue; } @@ -1022,7 +1022,7 @@ BOpt_GetBootOptions ( StringSize = StrSize((UINT16*)LoadOptionPtr); - NewLoadContext->Description = AllocateZeroPool (StringSize); + NewLoadContext->Description = AllocateZeroPool(StringSize); // ASSERT (NewLoadContext->Description != NULL); StrCpyS (NewLoadContext->Description, StringSize / sizeof(CHAR16), (UINT16*)LoadOptionPtr); @@ -1031,7 +1031,7 @@ BOpt_GetBootOptions ( LoadOptionPtr += StringSize; - NewLoadContext->FilePathList = AllocateZeroPool (NewLoadContext->FilePathListLength); + NewLoadContext->FilePathList = AllocateZeroPool(NewLoadContext->FilePathListLength); ASSERT (NewLoadContext->FilePathList != NULL); CopyMem ( NewLoadContext->FilePathList, @@ -1057,7 +1057,7 @@ BOpt_GetBootOptions ( StringSize - NewLoadContext->FilePathListLength; - NewLoadContext->OptionalData = AllocateZeroPool (OptionalDataSize); + NewLoadContext->OptionalData = AllocateZeroPool(OptionalDataSize); ASSERT (NewLoadContext->OptionalData != NULL); CopyMem ( NewLoadContext->OptionalData, @@ -1110,10 +1110,10 @@ BOpt_AppendFileName ( Size2 = StrSize (Str2); Size = Size1 + Size2 + sizeof (CHAR16); Len = Size / 2; //including zero terminating - Str = AllocateZeroPool (Size); + Str = AllocateZeroPool(Size); // ASSERT (Str != NULL); - TmpStr = AllocateZeroPool (Size); + TmpStr = AllocateZeroPool(Size); // ASSERT (TmpStr != NULL); StrCatS (Str, Len, Str1); @@ -1531,7 +1531,7 @@ BOpt_GetDriverOptions ( continue; } - LoadOption = AllocateZeroPool (DriverOptionSize); + LoadOption = AllocateZeroPool(DriverOptionSize); if (LoadOption == NULL) { continue; } @@ -1571,7 +1571,7 @@ BOpt_GetDriverOptions ( LoadOptionPtr += sizeof (UINT16); StringSize = StrSize ((UINT16 *) LoadOptionPtr); - NewLoadContext->Description = AllocateZeroPool (StringSize); + NewLoadContext->Description = AllocateZeroPool(StringSize); ASSERT (NewLoadContext->Description != NULL); CopyMem ( NewLoadContext->Description, @@ -1582,7 +1582,7 @@ BOpt_GetDriverOptions ( LoadOptionPtr += StringSize; - NewLoadContext->FilePathList = AllocateZeroPool (NewLoadContext->FilePathListLength); + NewLoadContext->FilePathList = AllocateZeroPool(NewLoadContext->FilePathListLength); ASSERT (NewLoadContext->FilePathList != NULL); CopyMem ( NewLoadContext->FilePathList, @@ -1608,7 +1608,7 @@ BOpt_GetDriverOptions ( StringSize - NewLoadContext->FilePathListLength; - NewLoadContext->OptionalData = AllocateZeroPool (OptionalDataSize); + NewLoadContext->OptionalData = AllocateZeroPool(OptionalDataSize); ASSERT (NewLoadContext->OptionalData != NULL); CopyMem ( NewLoadContext->OptionalData, diff --git a/CloverEFI/OsxBdsDxe/BootMaint/UpdatePage.c b/CloverEFI/OsxBdsDxe/BootMaint/UpdatePage.c index 708057e33..5e045d505 100644 --- a/CloverEFI/OsxBdsDxe/BootMaint/UpdatePage.c +++ b/CloverEFI/OsxBdsDxe/BootMaint/UpdatePage.c @@ -813,7 +813,7 @@ UpdateConModePage ( // ASSERT (OptionsOpCodeHandle != NULL); if (!OptionsOpCodeHandle) return; - ModeToken = AllocateZeroPool (sizeof (EFI_STRING_ID) * ValidMode); + ModeToken = AllocateZeroPool(sizeof (EFI_STRING_ID) * ValidMode); // ASSERT(ModeToken != NULL); if (!ModeToken) return; diff --git a/CloverEFI/OsxBdsDxe/BootMaint/Variable.c b/CloverEFI/OsxBdsDxe/BootMaint/Variable.c index 0e1cafa07..06b549210 100644 --- a/CloverEFI/OsxBdsDxe/BootMaint/Variable.c +++ b/CloverEFI/OsxBdsDxe/BootMaint/Variable.c @@ -138,7 +138,7 @@ Var_ChangeBootOrder ( BootOrderListSize = BootOptionMenu.MenuNumber; if (BootOrderListSize > 0) { - BootOrderList = AllocateZeroPool (BootOrderListSize * sizeof (UINT16)); + BootOrderList = AllocateZeroPool(BootOrderListSize * sizeof (UINT16)); // ASSERT (BootOrderList != NULL); BootOrderListPtr = BootOrderList; @@ -276,7 +276,7 @@ Var_ChangeDriverOrder ( DriverOrderListSize = DriverOptionMenu.MenuNumber; if (DriverOrderListSize > 0) { - DriverOrderList = AllocateZeroPool (DriverOrderListSize * sizeof (UINT16)); + DriverOrderList = AllocateZeroPool(DriverOrderListSize * sizeof (UINT16)); ASSERT (DriverOrderList != NULL); DriverOrderListPtr = DriverOrderList; @@ -583,7 +583,7 @@ Var_UpdateDriverOption ( BufferSize += StrSize (OptionalData); } - Buffer = AllocateZeroPool (BufferSize); + Buffer = AllocateZeroPool(BufferSize); if (NULL == Buffer) { return EFI_OUT_OF_RESOURCES; } @@ -615,7 +615,7 @@ Var_UpdateDriverOption ( StrSize (DescriptionData) ); - NewLoadContext->Description = AllocateZeroPool (StrSize (DescriptionData)); + NewLoadContext->Description = AllocateZeroPool(StrSize (DescriptionData)); ASSERT (NewLoadContext->Description != NULL); NewMenuEntry->DisplayString = NewLoadContext->Description; CopyMem ( @@ -631,7 +631,7 @@ Var_UpdateDriverOption ( GetDevicePathSize (CallbackData->LoadContext->FilePathList) ); - NewLoadContext->FilePathList = AllocateZeroPool (GetDevicePathSize (CallbackData->LoadContext->FilePathList)); + NewLoadContext->FilePathList = AllocateZeroPool(GetDevicePathSize (CallbackData->LoadContext->FilePathList)); ASSERT (NewLoadContext->FilePathList != NULL); CopyMem ( @@ -677,7 +677,7 @@ Var_UpdateDriverOption ( &gEfiGlobalVariableGuid, &DriverOrderListSize ); - NewDriverOrderList = AllocateZeroPool (DriverOrderListSize + sizeof (UINT16)); + NewDriverOrderList = AllocateZeroPool(DriverOrderListSize + sizeof (UINT16)); ASSERT (NewDriverOrderList != NULL); if (DriverOrderList != NULL) { CopyMem (NewDriverOrderList, DriverOrderList, DriverOrderListSize); @@ -767,7 +767,7 @@ Var_UpdateBootOption ( BufferSize += StrSize (NvRamMap->BootOptionalData); } - Buffer = AllocateZeroPool (BufferSize); + Buffer = AllocateZeroPool(BufferSize); if (NULL == Buffer) { return EFI_OUT_OF_RESOURCES; } @@ -799,7 +799,7 @@ Var_UpdateBootOption ( StrSize (NvRamMap->BootDescriptionData) ); - NewLoadContext->Description = AllocateZeroPool (StrSize (NvRamMap->BootDescriptionData)); + NewLoadContext->Description = AllocateZeroPool(StrSize (NvRamMap->BootDescriptionData)); ASSERT (NewLoadContext->Description != NULL); NewMenuEntry->DisplayString = NewLoadContext->Description; @@ -816,7 +816,7 @@ Var_UpdateBootOption ( GetDevicePathSize (CallbackData->LoadContext->FilePathList) ); - NewLoadContext->FilePathList = AllocateZeroPool (GetDevicePathSize (CallbackData->LoadContext->FilePathList)); + NewLoadContext->FilePathList = AllocateZeroPool(GetDevicePathSize (CallbackData->LoadContext->FilePathList)); ASSERT (NewLoadContext->FilePathList != NULL); CopyMem ( @@ -861,7 +861,7 @@ Var_UpdateBootOption ( ); // ASSERT (BootOrderList != NULL); if (BootOrderList != NULL) { - NewBootOrderList = AllocateZeroPool (BootOrderListSize + sizeof (UINT16)); + NewBootOrderList = AllocateZeroPool(BootOrderListSize + sizeof (UINT16)); // ASSERT (NewBootOrderList != NULL); if (NewBootOrderList != NULL) { CopyMem (NewBootOrderList, BootOrderList, BootOrderListSize); @@ -1064,7 +1064,7 @@ Var_UpdateDriverOrder ( &DriverOrderListSize ); - NewDriverOrderList = AllocateZeroPool (DriverOrderListSize); + NewDriverOrderList = AllocateZeroPool(DriverOrderListSize); if (NewDriverOrderList == NULL) { return EFI_OUT_OF_RESOURCES; @@ -1209,7 +1209,7 @@ Var_UpdateBBSOption ( return EFI_NOT_FOUND; } - NewOrder = AllocateZeroPool (DevOrder->Length - sizeof (DevOrder->Length)); + NewOrder = AllocateZeroPool(DevOrder->Length - sizeof (DevOrder->Length)); if (NewOrder == NULL) { FreePool(OriginalPtr); return EFI_OUT_OF_RESOURCES; diff --git a/CloverEFI/OsxBdsDxe/BootMngr/BootManager.c b/CloverEFI/OsxBdsDxe/BootMngr/BootManager.c index c0b26ed7e..02df6d3ee 100644 --- a/CloverEFI/OsxBdsDxe/BootMngr/BootManager.c +++ b/CloverEFI/OsxBdsDxe/BootMngr/BootManager.c @@ -330,7 +330,7 @@ CallBootManager ( TempStr = FileDevicePathToStr (Option->DevicePath); TempSize = StrSize (TempStr); HelpSize = TempSize + StrSize (L"Device Path : "); - HelpString = AllocateZeroPool (HelpSize); + HelpString = AllocateZeroPool(HelpSize); // ASSERT (HelpString != NULL); if (!HelpString) { return; diff --git a/CloverEFI/OsxBdsDxe/Capsules.c b/CloverEFI/OsxBdsDxe/Capsules.c index 4ac9bbd91..bc285a373 100644 --- a/CloverEFI/OsxBdsDxe/Capsules.c +++ b/CloverEFI/OsxBdsDxe/Capsules.c @@ -91,11 +91,11 @@ BdsProcessCapsules ( // // Init temp Capsule Data table. // - CapsulePtr = (VOID **) AllocateZeroPool (sizeof (VOID *) * CapsuleTotalNumber); + CapsulePtr = (VOID **) AllocateZeroPool(sizeof (VOID *) * CapsuleTotalNumber); // ASSERT (CapsulePtr != NULL); - CapsulePtrCache = (VOID **) AllocateZeroPool (sizeof (VOID *) * CapsuleTotalNumber); + CapsulePtrCache = (VOID **) AllocateZeroPool(sizeof (VOID *) * CapsuleTotalNumber); // ASSERT (CapsulePtrCache != NULL); - CapsuleGuidCache = (EFI_GUID *) AllocateZeroPool (sizeof (EFI_GUID) * CapsuleTotalNumber); + CapsuleGuidCache = (EFI_GUID *) AllocateZeroPool(sizeof (EFI_GUID) * CapsuleTotalNumber); // ASSERT (CapsuleGuidCache != NULL); // diff --git a/CloverEFI/OsxBdsDxe/DeviceMngr/DeviceManager.c b/CloverEFI/OsxBdsDxe/DeviceMngr/DeviceManager.c index 96500a3aa..ca293267b 100644 --- a/CloverEFI/OsxBdsDxe/DeviceMngr/DeviceManager.c +++ b/CloverEFI/OsxBdsDxe/DeviceMngr/DeviceManager.c @@ -387,7 +387,7 @@ GetMacAddressString( // The size is the Number size + ":" size + Vlan size(\XXXX) + End // BufferLen = (4 + 2 * HwAddressSize + (HwAddressSize - 1) + 5 + 1) * sizeof (CHAR16); - String = AllocateZeroPool (BufferLen); + String = AllocateZeroPool(BufferLen); if (String == NULL) { return FALSE; } @@ -770,14 +770,14 @@ AdjustArrayData ( // // +2 means include the new HiiHandle and the last empty NULL pointer. // - NewHiiHandles = AllocateZeroPool ((ArrayCount + 2) * sizeof (EFI_HII_HANDLE)); + NewHiiHandles = AllocateZeroPool((ArrayCount + 2) * sizeof (EFI_HII_HANDLE)); ASSERT (NewHiiHandles != NULL); CopyMem (NewHiiHandles, *HiiHandles, Offset * sizeof (EFI_HII_HANDLE)); NewHiiHandles[Offset] = NewHiiHandles[Offset - 1]; CopyMem (NewHiiHandles + Offset + 1, *HiiHandles + Offset, (ArrayCount - Offset) * sizeof (EFI_HII_HANDLE)); - NewGuidLists = AllocateZeroPool ((ArrayCount + 2) * sizeof (EFI_GUID *)); + NewGuidLists = AllocateZeroPool((ArrayCount + 2) * sizeof (EFI_GUID *)); ASSERT (NewGuidLists != NULL); CopyMem (NewGuidLists, *GuidLists, Offset * sizeof (EFI_GUID *)); @@ -932,7 +932,7 @@ CallDeviceManager ( } HandleNum = GetHiiHandleCount (HiiHandles); - GuidLists = AllocateZeroPool ((HandleNum + 1) * sizeof (EFI_GUID *)); + GuidLists = AllocateZeroPool((HandleNum + 1) * sizeof (EFI_GUID *)); ASSERT (GuidLists != NULL); // @@ -1392,7 +1392,7 @@ CallDriverHealth ( // // Assume no line strings is longer than 512 bytes. // - String = (EFI_STRING) AllocateZeroPool (0x200); + String = (EFI_STRING) AllocateZeroPool(0x200); // ASSERT (String != NULL); if (!String) { break; @@ -1722,7 +1722,7 @@ GetSingleControllerHealthStatus ( // // Add the driver health related information into the list // - DriverHealthInfo = AllocateZeroPool (sizeof (DRIVER_HEALTH_INFO)); + DriverHealthInfo = AllocateZeroPool(sizeof (DRIVER_HEALTH_INFO)); if (DriverHealthInfo == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -1759,7 +1759,7 @@ GetSingleControllerHealthStatus ( // // Add the driver health related information into the list // - DriverHealthInfo = AllocateZeroPool (sizeof (DRIVER_HEALTH_INFO)); + DriverHealthInfo = AllocateZeroPool(sizeof (DRIVER_HEALTH_INFO)); if (DriverHealthInfo == NULL) { return EFI_OUT_OF_RESOURCES; } diff --git a/CloverEFI/OsxBdsDxe/FrontPage.c b/CloverEFI/OsxBdsDxe/FrontPage.c index 53d6a7dd2..1c29f49b0 100644 --- a/CloverEFI/OsxBdsDxe/FrontPage.c +++ b/CloverEFI/OsxBdsDxe/FrontPage.c @@ -438,7 +438,7 @@ InitializeFrontPage ( // // Allocate extra 1 as the end tag. // - gFrontPagePrivate.LanguageToken = AllocateZeroPool ((OptionCount + 1) * sizeof (EFI_STRING_ID)); + gFrontPagePrivate.LanguageToken = AllocateZeroPool((OptionCount + 1) * sizeof (EFI_STRING_ID)); ASSERT (gFrontPagePrivate.LanguageToken != NULL); Status = gBS->LocateProtocol (&gEfiHiiStringProtocolGuid, NULL, (VOID **) &HiiString); @@ -452,7 +452,7 @@ InitializeFrontPage ( StringSize = 0; Status = HiiString->GetString (HiiString, Lang, HiiHandle, PRINTABLE_LANGUAGE_NAME_STRING_ID, StringBuffer, &StringSize, NULL); if (Status == EFI_BUFFER_TOO_SMALL) { - StringBuffer = AllocateZeroPool (StringSize); + StringBuffer = AllocateZeroPool(StringSize); ASSERT (StringBuffer != NULL); Status = HiiString->GetString (HiiString, Lang, HiiHandle, PRINTABLE_LANGUAGE_NAME_STRING_ID, StringBuffer, &StringSize, NULL); ASSERT_EFI_ERROR(Status); @@ -636,7 +636,7 @@ ConvertProcessorToString ( FreqMhz = 0; } - StringBuffer = AllocateZeroPool (0x20); + StringBuffer = AllocateZeroPool(0x20); // ASSERT (StringBuffer != NULL); if (!StringBuffer) { StringBuffer = L" "; @@ -665,7 +665,7 @@ ConvertMemorySizeToString ( { CHAR16 *StringBuffer; - StringBuffer = AllocateZeroPool (0x20); + StringBuffer = AllocateZeroPool(0x20); // ASSERT (StringBuffer != NULL); if (!StringBuffer) { StringBuffer = L" "; @@ -701,7 +701,7 @@ GetOptionalStringByIndex ( UINTN StrSize; if (Index == 0) { - *String = AllocateZeroPool (sizeof (CHAR16)); + *String = AllocateZeroPool(sizeof (CHAR16)); return EFI_SUCCESS; } diff --git a/CloverEFI/OsxBdsDxe/Hotkey.c b/CloverEFI/OsxBdsDxe/Hotkey.c index 2d9416313..63c8c27fb 100644 --- a/CloverEFI/OsxBdsDxe/Hotkey.c +++ b/CloverEFI/OsxBdsDxe/Hotkey.c @@ -571,7 +571,7 @@ HotkeyInsertList ( EFI_INPUT_KEY *InputKey; EFI_KEY_DATA *KeyData; - HotkeyLeft = AllocateZeroPool (sizeof (BDS_HOTKEY_OPTION)); + HotkeyLeft = AllocateZeroPool(sizeof (BDS_HOTKEY_OPTION)); if (HotkeyLeft == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -723,7 +723,7 @@ HotkeyGetOptionNumbers ( OptionNumbers = NULL; NameSize = sizeof (CHAR16); - Name = AllocateZeroPool (NameSize); + Name = AllocateZeroPool(NameSize); // ASSERT (Name != NULL); if (Name == NULL) { return NULL; diff --git a/CloverEFI/OsxBdsDxe/Language.c b/CloverEFI/OsxBdsDxe/Language.c index db1dccd13..f0d107b19 100644 --- a/CloverEFI/OsxBdsDxe/Language.c +++ b/CloverEFI/OsxBdsDxe/Language.c @@ -351,7 +351,7 @@ IsLangInSupportedLangCodes( if (Iso639Language) { CompareLength = ISO_639_2_ENTRY_SIZE; - for (Index = 0; Index < AsciiStrLen (SupportedLang); Index += CompareLength) { + for (Index = 0; Index < AsciiStrLen(SupportedLang); Index += CompareLength) { if (AsciiStrnCmp (Lang, SupportedLang + Index, CompareLength) == 0) { // // Successfully find the Lang string in SupportedLang string. diff --git a/CloverEFI/OsxDxeCore/Dispatcher/Dispatcher.c b/CloverEFI/OsxDxeCore/Dispatcher/Dispatcher.c index f1b7ecc63..964257254 100644 --- a/CloverEFI/OsxDxeCore/Dispatcher/Dispatcher.c +++ b/CloverEFI/OsxDxeCore/Dispatcher/Dispatcher.c @@ -796,7 +796,7 @@ FvIsBeingProcesssed ( } } - KnownHandle = AllocateZeroPool (sizeof (KNOWN_HANDLE)); + KnownHandle = AllocateZeroPool(sizeof (KNOWN_HANDLE)); ASSERT (KnownHandle != NULL); KnownHandle->Signature = KNOWN_HANDLE_SIGNATURE; @@ -895,7 +895,7 @@ CoreAddToDriverList ( // Create the Driver Entry for the list. ZeroPool initializes lots of variables to // NULL or FALSE. // - DriverEntry = AllocateZeroPool (sizeof (EFI_CORE_DRIVER_ENTRY)); + DriverEntry = AllocateZeroPool(sizeof (EFI_CORE_DRIVER_ENTRY)); ASSERT (DriverEntry != NULL); if (Type == EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE) { DriverEntry->IsFvImage = TRUE; diff --git a/CloverEFI/OsxDxeCore/Event/Event.c b/CloverEFI/OsxDxeCore/Event/Event.c index 782f5a367..42b15d2f7 100644 --- a/CloverEFI/OsxDxeCore/Event/Event.c +++ b/CloverEFI/OsxDxeCore/Event/Event.c @@ -462,7 +462,7 @@ CoreCreateEventInternal ( if ((Type & EVT_RUNTIME) != 0) { IEvent = AllocateRuntimeZeroPool (sizeof (IEVENT)); } else { - IEvent = AllocateZeroPool (sizeof (IEVENT)); + IEvent = AllocateZeroPool(sizeof (IEVENT)); } if (IEvent == NULL) { return EFI_OUT_OF_RESOURCES; diff --git a/CloverEFI/OsxDxeCore/FwVol/FwVol.c b/CloverEFI/OsxDxeCore/FwVol/FwVol.c index 1c82a78ce..fa1886828 100644 --- a/CloverEFI/OsxDxeCore/FwVol/FwVol.c +++ b/CloverEFI/OsxDxeCore/FwVol/FwVol.c @@ -497,7 +497,7 @@ FvCheck ( // // Create a FFS list entry for each non-deleted file // - FfsFileEntry = AllocateZeroPool (sizeof (FFS_FILE_LIST_ENTRY)); + FfsFileEntry = AllocateZeroPool(sizeof (FFS_FILE_LIST_ENTRY)); if (FfsFileEntry == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Done; diff --git a/CloverEFI/OsxDxeCore/Gcd/Gcd.c b/CloverEFI/OsxDxeCore/Gcd/Gcd.c index 1c2de84ed..d028ee5b8 100644 --- a/CloverEFI/OsxDxeCore/Gcd/Gcd.c +++ b/CloverEFI/OsxDxeCore/Gcd/Gcd.c @@ -381,12 +381,12 @@ CoreAllocateGcdMapEntry ( IN OUT EFI_GCD_MAP_ENTRY **BottomEntry ) { - *TopEntry = AllocateZeroPool (sizeof (EFI_GCD_MAP_ENTRY)); + *TopEntry = AllocateZeroPool(sizeof (EFI_GCD_MAP_ENTRY)); if (*TopEntry == NULL) { return EFI_OUT_OF_RESOURCES; } - *BottomEntry = AllocateZeroPool (sizeof (EFI_GCD_MAP_ENTRY)); + *BottomEntry = AllocateZeroPool(sizeof (EFI_GCD_MAP_ENTRY)); if (*BottomEntry == NULL) { CoreFreePool(*TopEntry); return EFI_OUT_OF_RESOURCES; diff --git a/CloverEFI/OsxDxeCore/Hand/Handle.c b/CloverEFI/OsxDxeCore/Hand/Handle.c index 36794e986..e638b8b69 100644 --- a/CloverEFI/OsxDxeCore/Hand/Handle.c +++ b/CloverEFI/OsxDxeCore/Hand/Handle.c @@ -394,7 +394,7 @@ CoreInstallProtocolInterfaceNotify ( // // Allocate a new protocol interface structure // - Prot = AllocateZeroPool (sizeof(PROTOCOL_INTERFACE)); + Prot = AllocateZeroPool(sizeof(PROTOCOL_INTERFACE)); if (Prot == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Done; @@ -405,7 +405,7 @@ CoreInstallProtocolInterfaceNotify ( // Handle = (IHANDLE *)*UserHandle; if (Handle == NULL) { - Handle = AllocateZeroPool (sizeof(IHANDLE)); + Handle = AllocateZeroPool(sizeof(IHANDLE)); if (Handle == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Done; diff --git a/CloverEFI/OsxDxeCore/Image/Image.c b/CloverEFI/OsxDxeCore/Image/Image.c index edbc4b3cc..c187cf6ff 100644 --- a/CloverEFI/OsxDxeCore/Image/Image.c +++ b/CloverEFI/OsxDxeCore/Image/Image.c @@ -1202,7 +1202,7 @@ CoreLoadImageCommon ( // // Allocate a new image structure // - Image = AllocateZeroPool (sizeof(LOADED_IMAGE_PRIVATE_DATA)); + Image = AllocateZeroPool(sizeof(LOADED_IMAGE_PRIVATE_DATA)); if (Image == NULL) { return EFI_OUT_OF_RESOURCES; } diff --git a/CloverEFI/OsxDxeCore/Misc/DebugImageInfo.c b/CloverEFI/OsxDxeCore/Misc/DebugImageInfo.c index b09ff2fdb..5e2c1d75b 100644 --- a/CloverEFI/OsxDxeCore/Misc/DebugImageInfo.c +++ b/CloverEFI/OsxDxeCore/Misc/DebugImageInfo.c @@ -201,7 +201,7 @@ CoreNewDebugImageInfoEntry ( // Table is full, so re-allocate another page for a larger table... // TableSize = mMaxTableEntries * EFI_DEBUG_TABLE_ENTRY_SIZE; - NewTable = AllocateZeroPool (TableSize + EFI_PAGE_SIZE); + NewTable = AllocateZeroPool(TableSize + EFI_PAGE_SIZE); if (NewTable == NULL) { mDebugInfoTableHeader.UpdateStatus &= ~EFI_DEBUG_IMAGE_INFO_UPDATE_IN_PROGRESS; return; @@ -230,7 +230,7 @@ CoreNewDebugImageInfoEntry ( // // Allocate data for new entry // - Table[Index].NormalImage = AllocateZeroPool (sizeof (EFI_DEBUG_IMAGE_INFO_NORMAL)); + Table[Index].NormalImage = AllocateZeroPool(sizeof (EFI_DEBUG_IMAGE_INFO_NORMAL)); if (Table[Index].NormalImage != NULL) { // // Update the entry diff --git a/CloverEFI/OsxDxeCore/SectionExtraction/CoreSectionExtraction.c b/CloverEFI/OsxDxeCore/SectionExtraction/CoreSectionExtraction.c index 5b8279765..fda707943 100644 --- a/CloverEFI/OsxDxeCore/SectionExtraction/CoreSectionExtraction.c +++ b/CloverEFI/OsxDxeCore/SectionExtraction/CoreSectionExtraction.c @@ -697,7 +697,7 @@ CreateChildNode ( // // Allocate a new node // - *ChildNode = AllocateZeroPool (sizeof (CORE_SECTION_CHILD_NODE)); + *ChildNode = AllocateZeroPool(sizeof (CORE_SECTION_CHILD_NODE)); Node = *ChildNode; if (Node == NULL) { return EFI_OUT_OF_RESOURCES; diff --git a/CloverEFI/OsxPciBusNoEnumerationDxe/PciIo.c b/CloverEFI/OsxPciBusNoEnumerationDxe/PciIo.c index 0c5bdf257..05dcfe635 100644 --- a/CloverEFI/OsxPciBusNoEnumerationDxe/PciIo.c +++ b/CloverEFI/OsxPciBusNoEnumerationDxe/PciIo.c @@ -1635,7 +1635,7 @@ Returns: } if (Resources != NULL) { - Configuration = AllocateZeroPool (sizeof (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR) + sizeof (EFI_ACPI_END_TAG_DESCRIPTOR)); + Configuration = AllocateZeroPool(sizeof (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR) + sizeof (EFI_ACPI_END_TAG_DESCRIPTOR)); if (Configuration == NULL) { return EFI_OUT_OF_RESOURCES; } diff --git a/CloverEFI/OsxSmbiosGenDxe/SmbiosGen.c b/CloverEFI/OsxSmbiosGenDxe/SmbiosGen.c index 60dcda029..7840ae473 100644 --- a/CloverEFI/OsxSmbiosGenDxe/SmbiosGen.c +++ b/CloverEFI/OsxSmbiosGenDxe/SmbiosGen.c @@ -70,7 +70,7 @@ InstallProcessorSmbios ( // Set ProcessorVersion string // AString = GetSmbiosString (SmbiosTable, SmbiosTable.Type4->ProcessorVersion); - UString = AllocateZeroPool ((AsciiStrLen(AString) + 1) * sizeof(CHAR16)); + UString = AllocateZeroPool((AsciiStrLen(AString) + 1) * sizeof(CHAR16)); ASSERT (UString != NULL); AsciiStrToUnicodeStr (AString, UString); @@ -137,7 +137,7 @@ InstallMiscSmbios ( // Record Type 2 // AString = GetSmbiosString (SmbiosTable, SmbiosTable.Type0->BiosVersion); - UString = AllocateZeroPool ((AsciiStrLen(AString) + 1) * sizeof(CHAR16) + sizeof(FIRMWARE_BIOS_VERSIONE)); + UString = AllocateZeroPool((AsciiStrLen(AString) + 1) * sizeof(CHAR16) + sizeof(FIRMWARE_BIOS_VERSIONE)); ASSERT (UString != NULL); CopyMem (UString, FIRMWARE_BIOS_VERSIONE, sizeof(FIRMWARE_BIOS_VERSIONE)); AsciiStrToUnicodeStr (AString, UString + sizeof(FIRMWARE_BIOS_VERSIONE) / sizeof(CHAR16) - 1); @@ -167,7 +167,7 @@ InstallMiscSmbios ( // Record Type 3 // AString = GetSmbiosString (SmbiosTable, SmbiosTable.Type1->ProductName); - UString = AllocateZeroPool ((AsciiStrLen(AString) + 1) * sizeof(CHAR16) + sizeof(FIRMWARE_PRODUCT_NAME)); + UString = AllocateZeroPool((AsciiStrLen(AString) + 1) * sizeof(CHAR16) + sizeof(FIRMWARE_PRODUCT_NAME)); ASSERT (UString != NULL); CopyMem (UString, FIRMWARE_PRODUCT_NAME, sizeof(FIRMWARE_PRODUCT_NAME)); AsciiStrToUnicodeStr (AString, UString + sizeof(FIRMWARE_PRODUCT_NAME) / sizeof(CHAR16) - 1); diff --git a/CloverEFI/PciRootBridgeDxe/DeviceIo.c b/CloverEFI/PciRootBridgeDxe/DeviceIo.c index 8545c21cf..8e6e0d8ae 100644 --- a/CloverEFI/PciRootBridgeDxe/DeviceIo.c +++ b/CloverEFI/PciRootBridgeDxe/DeviceIo.c @@ -57,7 +57,7 @@ Returns: // // Initialize the Device IO device instance. // - Private = AllocateZeroPool (sizeof (DEVICE_IO_PRIVATE_DATA)); + Private = AllocateZeroPool(sizeof (DEVICE_IO_PRIVATE_DATA)); if (Private == NULL) { return EFI_OUT_OF_RESOURCES; } diff --git a/CloverEFI/UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.c b/CloverEFI/UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.c index f8cbcf080..d3e3eb6d4 100644 --- a/CloverEFI/UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.c +++ b/CloverEFI/UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.c @@ -56,7 +56,7 @@ InternalPrintMessage ( // // Send the print string to a Serial Port // - SerialPortWrite ((UINT8 *)Buffer, AsciiStrLen (Buffer)); + SerialPortWrite ((UINT8 *)Buffer, AsciiStrLen(Buffer)); } /** @@ -170,4 +170,4 @@ ReadAndVerifyVectorInfo ( VectorInfo ++; } return EFI_SUCCESS; -} \ No newline at end of file +} diff --git a/CloverEFI/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c b/CloverEFI/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c index ae60e6db4..baf443ac3 100644 --- a/CloverEFI/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c +++ b/CloverEFI/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c @@ -89,7 +89,7 @@ InitializeCpuInterruptHandlers ( } } InitializeSpinLock (&mDisplayMessageSpinLock); - mExternalInterruptHandler = AllocateZeroPool (sizeof (EFI_CPU_INTERRUPT_HANDLER) * CPU_INTERRUPT_NUM); + mExternalInterruptHandler = AllocateZeroPool(sizeof (EFI_CPU_INTERRUPT_HANDLER) * CPU_INTERRUPT_NUM); ASSERT (mExternalInterruptHandler != NULL); // @@ -103,7 +103,7 @@ InitializeCpuInterruptHandlers ( // // Create Interrupt Descriptor Table and Copy the old IDT table in // - IdtTable = AllocateZeroPool (sizeof (IA32_IDT_GATE_DESCRIPTOR) * CPU_INTERRUPT_NUM); + IdtTable = AllocateZeroPool(sizeof (IA32_IDT_GATE_DESCRIPTOR) * CPU_INTERRUPT_NUM); ASSERT (IdtTable != NULL); CopyMem (IdtTable, (VOID *)IdtDescriptor.Base, sizeof (IA32_IDT_GATE_DESCRIPTOR) * IdtEntryCount); diff --git a/Drivers/AtaAtapi/AtaAtapiPassThru.c b/Drivers/AtaAtapi/AtaAtapiPassThru.c index 85a60de95..de23069eb 100644 --- a/Drivers/AtaAtapi/AtaAtapiPassThru.c +++ b/Drivers/AtaAtapi/AtaAtapiPassThru.c @@ -1062,7 +1062,7 @@ CreateNewDeviceInfo ( { EFI_ATA_DEVICE_INFO *DeviceInfo; - DeviceInfo = AllocateZeroPool (sizeof (EFI_ATA_DEVICE_INFO)); + DeviceInfo = AllocateZeroPool(sizeof (EFI_ATA_DEVICE_INFO)); if (DeviceInfo == NULL) { return EFI_OUT_OF_RESOURCES; @@ -1364,7 +1364,7 @@ AtaPassThruPassThru ( // For non-blocking mode, queue the Task into the list. // if (Event != NULL) { - Task = AllocateZeroPool (sizeof (ATA_NONBLOCK_TASK)); + Task = AllocateZeroPool(sizeof (ATA_NONBLOCK_TASK)); if (Task == NULL) { return EFI_OUT_OF_RESOURCES; } diff --git a/Drivers/AtaBus/AtaBus.c b/Drivers/AtaBus/AtaBus.c index ab3d2f3b9..73e009565 100644 --- a/Drivers/AtaBus/AtaBus.c +++ b/Drivers/AtaBus/AtaBus.c @@ -867,7 +867,7 @@ AtaBusDriverBindingStart ( // Check EFI_ALREADY_STARTED to reuse the original ATA_BUS_DRIVER_DATA. // if (Status != EFI_ALREADY_STARTED) { - AtaBusDriverData = AllocateZeroPool (sizeof (ATA_BUS_DRIVER_DATA)); + AtaBusDriverData = AllocateZeroPool(sizeof (ATA_BUS_DRIVER_DATA)); if (AtaBusDriverData == NULL) { Status = EFI_OUT_OF_RESOURCES; goto ErrorExit; diff --git a/Drivers/AtaBus/AtaPassThruExecute.c b/Drivers/AtaBus/AtaPassThruExecute.c index eaca7094b..60c2320df 100644 --- a/Drivers/AtaBus/AtaPassThruExecute.c +++ b/Drivers/AtaBus/AtaPassThruExecute.c @@ -770,7 +770,7 @@ AccessAtaDevice( if ((Token != NULL) && (Token->Event != NULL)) { OldTpl = gBS->RaiseTPL (TPL_NOTIFY); if (!IsListEmpty (&AtaDevice->AtaSubTaskList)) { - AtaTask = AllocateZeroPool (sizeof (ATA_BUS_ASYN_TASK)); + AtaTask = AllocateZeroPool(sizeof (ATA_BUS_ASYN_TASK)); if (AtaTask == NULL) { gBS->RestoreTPL (OldTpl); return EFI_OUT_OF_RESOURCES; @@ -790,12 +790,12 @@ AccessAtaDevice( gBS->RestoreTPL (OldTpl); Token->TransactionStatus = EFI_SUCCESS; - EventCount = AllocateZeroPool (sizeof (UINTN)); + EventCount = AllocateZeroPool(sizeof (UINTN)); if (EventCount == NULL) { return EFI_OUT_OF_RESOURCES; } - IsError = AllocateZeroPool (sizeof (BOOLEAN)); + IsError = AllocateZeroPool(sizeof (BOOLEAN)); if (IsError == NULL) { FreePool(EventCount); return EFI_OUT_OF_RESOURCES; @@ -831,7 +831,7 @@ AccessAtaDevice( // SubTask = NULL; SubEvent = NULL; - SubTask = AllocateZeroPool (sizeof (ATA_BUS_ASYN_SUB_TASK)); + SubTask = AllocateZeroPool(sizeof (ATA_BUS_ASYN_SUB_TASK)); if (SubTask == NULL) { Status = EFI_OUT_OF_RESOURCES; goto EXIT; diff --git a/Drivers/DVDBus/ScsiBus.c b/Drivers/DVDBus/ScsiBus.c index ad096c010..b1afdfdab 100644 --- a/Drivers/DVDBus/ScsiBus.c +++ b/Drivers/DVDBus/ScsiBus.c @@ -1147,7 +1147,7 @@ ScsiScanCreateDevice ( goto ErrorExit; } - ScsiIoDevice = AllocateZeroPool (sizeof (SCSI_IO_DEV)); + ScsiIoDevice = AllocateZeroPool(sizeof (SCSI_IO_DEV)); if (ScsiIoDevice == NULL) { DBG(L"AllocateZeroPool Status=%r\n", Status); Status = EFI_OUT_OF_RESOURCES; diff --git a/Drivers/DVDDisk/ScsiDisk.c b/Drivers/DVDDisk/ScsiDisk.c index 83cc023c5..fa29fd600 100644 --- a/Drivers/DVDDisk/ScsiDisk.c +++ b/Drivers/DVDDisk/ScsiDisk.c @@ -212,7 +212,7 @@ ScsiDiskDriverBindingStart ( MustReadCapacity = TRUE; - ScsiDiskDevice = (SCSI_DISK_DEV *) AllocateZeroPool (sizeof (SCSI_DISK_DEV)); + ScsiDiskDevice = (SCSI_DISK_DEV *) AllocateZeroPool(sizeof (SCSI_DISK_DEV)); if (ScsiDiskDevice == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -256,7 +256,7 @@ ScsiDiskDriverBindingStart ( // The Sense Data Array's initial size is 6 // ScsiDiskDevice->SenseDataNumber = 6; - ScsiDiskDevice->SenseData = (EFI_SCSI_SENSE_DATA *) AllocateZeroPool ( + ScsiDiskDevice->SenseData = (EFI_SCSI_SENSE_DATA *) AllocateZeroPool( sizeof (EFI_SCSI_SENSE_DATA) * ScsiDiskDevice->SenseDataNumber ); if (ScsiDiskDevice->SenseData == NULL) { diff --git a/Drivers/Isa/IsaBusDxe/IsaBus.c b/Drivers/Isa/IsaBusDxe/IsaBus.c index 21144105c..b012fb0b7 100644 --- a/Drivers/Isa/IsaBusDxe/IsaBus.c +++ b/Drivers/Isa/IsaBusDxe/IsaBus.c @@ -589,7 +589,7 @@ IsaCreateDevice ( // // Initialize the PCI_IO_DEVICE structure // - IsaIoDevice = AllocateZeroPool (sizeof (ISA_IO_DEVICE)); + IsaIoDevice = AllocateZeroPool(sizeof (ISA_IO_DEVICE)); if (IsaIoDevice == NULL) { return EFI_OUT_OF_RESOURCES; } diff --git a/Drivers/Isa/Ps2KeyboardDxe/Ps2KbdTextIn.c b/Drivers/Isa/Ps2KeyboardDxe/Ps2KbdTextIn.c index 9ead5a8ce..19558bb25 100644 --- a/Drivers/Isa/Ps2KeyboardDxe/Ps2KbdTextIn.c +++ b/Drivers/Isa/Ps2KeyboardDxe/Ps2KbdTextIn.c @@ -600,7 +600,7 @@ KeyboardRegisterKeyNotify ( // // Allocate resource to save the notification function // - NewNotify = (KEYBOARD_CONSOLE_IN_EX_NOTIFY *) AllocateZeroPool (sizeof (KEYBOARD_CONSOLE_IN_EX_NOTIFY)); + NewNotify = (KEYBOARD_CONSOLE_IN_EX_NOTIFY *) AllocateZeroPool(sizeof (KEYBOARD_CONSOLE_IN_EX_NOTIFY)); if (NewNotify == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Exit; diff --git a/Drivers/Isa/Ps2KeyboardDxe/Ps2Keyboard.c b/Drivers/Isa/Ps2KeyboardDxe/Ps2Keyboard.c index a7e36b9af..432f01019 100644 --- a/Drivers/Isa/Ps2KeyboardDxe/Ps2Keyboard.c +++ b/Drivers/Isa/Ps2KeyboardDxe/Ps2Keyboard.c @@ -226,7 +226,7 @@ KbdControllerDriverStart ( // // Allocate private data // - ConsoleIn = AllocateZeroPool (sizeof (KEYBOARD_CONSOLE_IN_DEV)); + ConsoleIn = AllocateZeroPool(sizeof (KEYBOARD_CONSOLE_IN_DEV)); if (ConsoleIn == NULL) { Status = EFI_OUT_OF_RESOURCES; StatusCode = EFI_PERIPHERAL_KEYBOARD | EFI_P_EC_CONTROLLER_ERROR; diff --git a/Drivers/Isa/Ps2MouseAbsolutePointerDxe/Ps2MouseAbsolutePointer.c b/Drivers/Isa/Ps2MouseAbsolutePointerDxe/Ps2MouseAbsolutePointer.c index c2db87318..eaf9760da 100644 --- a/Drivers/Isa/Ps2MouseAbsolutePointerDxe/Ps2MouseAbsolutePointer.c +++ b/Drivers/Isa/Ps2MouseAbsolutePointerDxe/Ps2MouseAbsolutePointer.c @@ -195,7 +195,7 @@ PS2MouseAbsolutePointerDriverStart ( // // Allocate private data // - MouseAbsolutePointerDev = AllocateZeroPool (sizeof (PS2_MOUSE_ABSOLUTE_POINTER_DEV)); + MouseAbsolutePointerDev = AllocateZeroPool(sizeof (PS2_MOUSE_ABSOLUTE_POINTER_DEV)); if (MouseAbsolutePointerDev == NULL) { Status = EFI_OUT_OF_RESOURCES; goto ErrorExit; diff --git a/Drivers/Isa/Ps2MouseDxe/Ps2Mouse.c b/Drivers/Isa/Ps2MouseDxe/Ps2Mouse.c index 2830fb80f..568ab664d 100644 --- a/Drivers/Isa/Ps2MouseDxe/Ps2Mouse.c +++ b/Drivers/Isa/Ps2MouseDxe/Ps2Mouse.c @@ -198,7 +198,7 @@ PS2MouseDriverStart ( // // Allocate private data // - MouseDev = AllocateZeroPool (sizeof (PS2_MOUSE_DEV)); + MouseDev = AllocateZeroPool(sizeof (PS2_MOUSE_DEV)); if (MouseDev == NULL) { Status = EFI_OUT_OF_RESOURCES; goto ErrorExit; diff --git a/Drivers/OhciDxe/Ohci.c b/Drivers/OhciDxe/Ohci.c index 57cab264b..ecb163350 100644 --- a/Drivers/OhciDxe/Ohci.c +++ b/Drivers/OhciDxe/Ohci.c @@ -2042,7 +2042,7 @@ OhciAllocateDev ( UINTN Pages; UINTN Bytes; - Ohc = AllocateZeroPool (sizeof (USB_OHCI_HC_DEV)); + Ohc = AllocateZeroPool(sizeof (USB_OHCI_HC_DEV)); if (Ohc == NULL) { return NULL; } diff --git a/Drivers/PartitionDxe/Gpt.c b/Drivers/PartitionDxe/Gpt.c index 23216c304..75ad581f2 100644 --- a/Drivers/PartitionDxe/Gpt.c +++ b/Drivers/PartitionDxe/Gpt.c @@ -275,12 +275,12 @@ PartitionInstallGptChildHandles ( // // Allocate the GPT structures // - PrimaryHeader = AllocateZeroPool (sizeof (EFI_PARTITION_TABLE_HEADER)); + PrimaryHeader = AllocateZeroPool(sizeof (EFI_PARTITION_TABLE_HEADER)); if (PrimaryHeader == NULL) { goto Done; } - BackupHeader = AllocateZeroPool (sizeof (EFI_PARTITION_TABLE_HEADER)); + BackupHeader = AllocateZeroPool(sizeof (EFI_PARTITION_TABLE_HEADER)); if (BackupHeader == NULL) { goto Done; } @@ -346,7 +346,7 @@ PartitionInstallGptChildHandles ( // DEBUG ((EFI_D_INFO, " Number of partition entries: %d\n", PrimaryHeader->NumberOfPartitionEntries)); - PEntryStatus = AllocateZeroPool (PrimaryHeader->NumberOfPartitionEntries * sizeof (EFI_PARTITION_ENTRY_STATUS)); + PEntryStatus = AllocateZeroPool(PrimaryHeader->NumberOfPartitionEntries * sizeof (EFI_PARTITION_ENTRY_STATUS)); if (PEntryStatus == NULL) { // DEBUG ((EFI_D_ERROR, "Allocate pool error\n")); goto Done; @@ -467,7 +467,7 @@ PartitionValidGptTable ( BlockSize = BlockIo->Media->BlockSize; MediaId = BlockIo->Media->MediaId; - PartHdr = AllocateZeroPool (BlockSize); + PartHdr = AllocateZeroPool(BlockSize); if (PartHdr == NULL) { DEBUG ((EFI_D_ERROR, "Allocate pool error\n")); @@ -609,7 +609,7 @@ PartitionRestoreGptTable ( BlockSize = BlockIo->Media->BlockSize; MediaId = BlockIo->Media->MediaId; - PartHdr = AllocateZeroPool (BlockSize); + PartHdr = AllocateZeroPool(BlockSize); if (PartHdr == NULL) { DEBUG ((EFI_D_ERROR, "Allocate pool error\n")); diff --git a/Drivers/PartitionDxe/Partition.c b/Drivers/PartitionDxe/Partition.c index 0eb4f3025..8648a064c 100644 --- a/Drivers/PartitionDxe/Partition.c +++ b/Drivers/PartitionDxe/Partition.c @@ -1121,7 +1121,7 @@ PartitionInstallChildHandle ( PARTITION_PRIVATE_DATA *Private; Status = EFI_SUCCESS; - Private = AllocateZeroPool (sizeof (PARTITION_PRIVATE_DATA)); + Private = AllocateZeroPool(sizeof (PARTITION_PRIVATE_DATA)); if (Private == NULL) { return EFI_OUT_OF_RESOURCES; } diff --git a/Drivers/SataControllerDxe/SataController.c b/Drivers/SataControllerDxe/SataController.c index 73f5b331e..869951e24 100644 --- a/Drivers/SataControllerDxe/SataController.c +++ b/Drivers/SataControllerDxe/SataController.c @@ -446,7 +446,7 @@ SataControllerStart ( // // Allocate Sata Private Data structure // - SataPrivateData = AllocateZeroPool (sizeof (EFI_SATA_CONTROLLER_PRIVATE_DATA)); + SataPrivateData = AllocateZeroPool(sizeof (EFI_SATA_CONTROLLER_PRIVATE_DATA)); if (SataPrivateData == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Done; @@ -519,19 +519,19 @@ SataControllerStart ( } ChannelDeviceCount = (UINTN) (SataPrivateData->IdeInit.ChannelCount) * (UINTN) (SataPrivateData->DeviceCount); - SataPrivateData->DisqulifiedModes = AllocateZeroPool ((sizeof (EFI_ATA_COLLECTIVE_MODE)) * ChannelDeviceCount); + SataPrivateData->DisqulifiedModes = AllocateZeroPool((sizeof (EFI_ATA_COLLECTIVE_MODE)) * ChannelDeviceCount); if (SataPrivateData->DisqulifiedModes == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Done; } - SataPrivateData->IdentifyData = AllocateZeroPool ((sizeof (EFI_IDENTIFY_DATA)) * ChannelDeviceCount); + SataPrivateData->IdentifyData = AllocateZeroPool((sizeof (EFI_IDENTIFY_DATA)) * ChannelDeviceCount); if (SataPrivateData->IdentifyData == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Done; } - SataPrivateData->IdentifyValid = AllocateZeroPool ((sizeof (BOOLEAN)) * ChannelDeviceCount); + SataPrivateData->IdentifyValid = AllocateZeroPool((sizeof (BOOLEAN)) * ChannelDeviceCount); if (SataPrivateData->IdentifyValid == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Done; @@ -826,19 +826,19 @@ IdeInitNotifyPhase ( } ChannelDeviceCount = (UINTN) (SataPrivateData->IdeInit.ChannelCount) * (UINTN) (SataPrivateData->DeviceCount); - SataPrivateData->DisqulifiedModes = AllocateZeroPool ((sizeof (EFI_ATA_COLLECTIVE_MODE)) * ChannelDeviceCount); + SataPrivateData->DisqulifiedModes = AllocateZeroPool((sizeof (EFI_ATA_COLLECTIVE_MODE)) * ChannelDeviceCount); if (SataPrivateData->DisqulifiedModes == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Done; } - SataPrivateData->IdentifyData = AllocateZeroPool ((sizeof (EFI_IDENTIFY_DATA)) * ChannelDeviceCount); + SataPrivateData->IdentifyData = AllocateZeroPool((sizeof (EFI_IDENTIFY_DATA)) * ChannelDeviceCount); if (SataPrivateData->IdentifyData == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Done; } - SataPrivateData->IdentifyValid = AllocateZeroPool ((sizeof (BOOLEAN)) * ChannelDeviceCount); + SataPrivateData->IdentifyValid = AllocateZeroPool((sizeof (BOOLEAN)) * ChannelDeviceCount); if (SataPrivateData->IdentifyValid == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Done; @@ -1095,7 +1095,7 @@ IdeInitCalculateMode ( return EFI_INVALID_PARAMETER; } - *SupportedModes = AllocateZeroPool (sizeof (EFI_ATA_COLLECTIVE_MODE)); + *SupportedModes = AllocateZeroPool(sizeof (EFI_ATA_COLLECTIVE_MODE)); if (*SupportedModes == NULL) { return EFI_OUT_OF_RESOURCES; } diff --git a/Drivers/UsbBusDxe/UsbBus.c b/Drivers/UsbBusDxe/UsbBus.c index 8a57421c5..d68920c81 100644 --- a/Drivers/UsbBusDxe/UsbBus.c +++ b/Drivers/UsbBusDxe/UsbBus.c @@ -791,7 +791,7 @@ UsbIoGetStringDescriptor ( goto FREE_STR; } - Buf = AllocateZeroPool (StrDesc->Length); + Buf = AllocateZeroPool(StrDesc->Length); if (Buf == NULL) { Status = EFI_OUT_OF_RESOURCES; @@ -929,7 +929,7 @@ UsbBusBuildProtocol ( EFI_STATUS Status; EFI_STATUS Status2; - UsbBus = AllocateZeroPool (sizeof (USB_BUS)); + UsbBus = AllocateZeroPool(sizeof (USB_BUS)); if (UsbBus == NULL) { return EFI_OUT_OF_RESOURCES; @@ -1030,14 +1030,14 @@ UsbBusBuildProtocol ( // // Create a fake usb device for root hub // - RootHub = AllocateZeroPool (sizeof (USB_DEVICE)); + RootHub = AllocateZeroPool(sizeof (USB_DEVICE)); if (RootHub == NULL) { Status = EFI_OUT_OF_RESOURCES; goto UNINSTALL_USBBUS; } - RootIf = AllocateZeroPool (sizeof (USB_INTERFACE)); + RootIf = AllocateZeroPool(sizeof (USB_INTERFACE)); if (RootIf == NULL) { FreePool(RootHub); diff --git a/Drivers/UsbBusDxe/UsbDesc.c b/Drivers/UsbBusDxe/UsbDesc.c index 6ac9c1f28..42ed3ae58 100644 --- a/Drivers/UsbBusDxe/UsbDesc.c +++ b/Drivers/UsbBusDxe/UsbDesc.c @@ -205,7 +205,7 @@ UsbCreateDesc ( return NULL; } - Desc = AllocateZeroPool ((UINTN) CtrlLen); + Desc = AllocateZeroPool((UINTN) CtrlLen); if (Desc == NULL) { return NULL; } @@ -264,7 +264,7 @@ UsbParseInterfaceDesc ( goto ON_EXIT; } - Setting->Endpoints = AllocateZeroPool (sizeof (USB_ENDPOINT_DESC *) * NumEp); + Setting->Endpoints = AllocateZeroPool(sizeof (USB_ENDPOINT_DESC *) * NumEp); if (Setting->Endpoints == NULL) { goto ON_ERROR; @@ -330,7 +330,7 @@ UsbParseConfigDesc ( // Initialize an array of setting for the configuration's interfaces. // NumIf = Config->Desc.NumInterfaces; - Config->Interfaces = AllocateZeroPool (sizeof (USB_INTERFACE_DESC *) * NumIf); + Config->Interfaces = AllocateZeroPool(sizeof (USB_INTERFACE_DESC *) * NumIf); if (Config->Interfaces == NULL) { goto ON_ERROR; @@ -340,7 +340,7 @@ UsbParseConfigDesc ( Config->Desc.ConfigurationValue, (UINT32)NumIf)); for (Index = 0; Index < NumIf; Index++) { - Interface = AllocateZeroPool (sizeof (USB_INTERFACE_DESC)); + Interface = AllocateZeroPool(sizeof (USB_INTERFACE_DESC)); if (Interface == NULL) { goto ON_ERROR; @@ -574,7 +574,7 @@ UsbGetDevDesc ( USB_DEVICE_DESC *DevDesc; EFI_STATUS Status; - DevDesc = AllocateZeroPool (sizeof (USB_DEVICE_DESC)); + DevDesc = AllocateZeroPool(sizeof (USB_DEVICE_DESC)); if (DevDesc == NULL) { return EFI_OUT_OF_RESOURCES; @@ -631,7 +631,7 @@ UsbGetOneString ( return NULL; } - Buf = AllocateZeroPool (Desc.Length); + Buf = AllocateZeroPool(Desc.Length); if (Buf == NULL) { return NULL; @@ -744,7 +744,7 @@ UsbGetOneConfig ( DEBUG (( EFI_D_INFO, "UsbGetOneConfig: total length is %d\n", Desc.TotalLength)); - Buf = AllocateZeroPool (Desc.TotalLength); + Buf = AllocateZeroPool(Desc.TotalLength); if (Buf == NULL) { return NULL; @@ -803,7 +803,7 @@ UsbBuildDescTable ( return EFI_DEVICE_ERROR; } - DevDesc->Configs = AllocateZeroPool (NumConfig * sizeof (USB_CONFIG_DESC *)); + DevDesc->Configs = AllocateZeroPool(NumConfig * sizeof (USB_CONFIG_DESC *)); if (DevDesc->Configs == NULL) { return EFI_OUT_OF_RESOURCES; } diff --git a/Drivers/UsbBusDxe/UsbEnumer.c b/Drivers/UsbBusDxe/UsbEnumer.c index 34b7cd62e..c3d330553 100644 --- a/Drivers/UsbBusDxe/UsbEnumer.c +++ b/Drivers/UsbBusDxe/UsbEnumer.c @@ -117,7 +117,7 @@ UsbCreateInterface ( USB_INTERFACE *HubIf; EFI_STATUS Status; - UsbIf = AllocateZeroPool (sizeof (USB_INTERFACE)); + UsbIf = AllocateZeroPool(sizeof (USB_INTERFACE)); if (UsbIf == NULL) { return NULL; @@ -251,7 +251,7 @@ UsbCreateDevice ( return NULL; } - Device = AllocateZeroPool (sizeof (USB_DEVICE)); + Device = AllocateZeroPool(sizeof (USB_DEVICE)); if (Device == NULL) { return NULL; diff --git a/Drivers/UsbBusDxe/UsbHub.c b/Drivers/UsbBusDxe/UsbHub.c index 33aaddb93..8d052edcc 100644 --- a/Drivers/UsbBusDxe/UsbHub.c +++ b/Drivers/UsbBusDxe/UsbHub.c @@ -678,7 +678,7 @@ UsbOnHubInterrupt ( // practise since UsbOnHubInterrupt is called in the context // of host contrller's AsyncInterrupt monitor. // - HubIf->ChangeMap = AllocateZeroPool (DataLength); + HubIf->ChangeMap = AllocateZeroPool(DataLength); if (HubIf->ChangeMap == NULL) { return EFI_OUT_OF_RESOURCES; diff --git a/Drivers/UsbBusDxe/UsbUtility.c b/Drivers/UsbBusDxe/UsbUtility.c index 6fe1150cf..af6628f7a 100644 --- a/Drivers/UsbBusDxe/UsbUtility.c +++ b/Drivers/UsbBusDxe/UsbUtility.c @@ -810,7 +810,7 @@ GetUsbDPFromFullDP ( // // Create a new device path which only contain the above Usb part // - UsbDevicePathPtr = AllocateZeroPool (Size + sizeof (EFI_DEVICE_PATH_PROTOCOL)); + UsbDevicePathPtr = AllocateZeroPool(Size + sizeof (EFI_DEVICE_PATH_PROTOCOL)); // ASSERT (UsbDevicePathPtr != NULL); if (!UsbDevicePathPtr) { return NULL; @@ -911,7 +911,7 @@ AddUsbDPToList ( // // Prepare the usbio device path DEVICE_PATH_LIST_ITEM structure. // - ListItem = AllocateZeroPool (sizeof (DEVICE_PATH_LIST_ITEM)); + ListItem = AllocateZeroPool(sizeof (DEVICE_PATH_LIST_ITEM)); // ASSERT (ListItem != NULL); if (!ListItem) { return EFI_NOT_FOUND; diff --git a/Drivers/UsbKbDxe/EfiKey.c b/Drivers/UsbKbDxe/EfiKey.c index e0df7c292..2b0344eb6 100644 --- a/Drivers/UsbKbDxe/EfiKey.c +++ b/Drivers/UsbKbDxe/EfiKey.c @@ -210,7 +210,7 @@ USBKeyboardDriverBindingStart ( goto ErrorExit1; } - UsbKeyboardDevice = AllocateZeroPool (sizeof (USB_KB_DEV)); + UsbKeyboardDevice = AllocateZeroPool(sizeof (USB_KB_DEV)); // ASSERT (UsbKeyboardDevice != NULL); if (!UsbKeyboardDevice) { goto ErrorExit1; @@ -1287,7 +1287,7 @@ USBKeyboardRegisterKeyNotify ( // // Allocate resource to save the notification function // - NewNotify = (KEYBOARD_CONSOLE_IN_EX_NOTIFY *) AllocateZeroPool (sizeof (KEYBOARD_CONSOLE_IN_EX_NOTIFY)); + NewNotify = (KEYBOARD_CONSOLE_IN_EX_NOTIFY *) AllocateZeroPool(sizeof (KEYBOARD_CONSOLE_IN_EX_NOTIFY)); if (NewNotify == NULL) { return EFI_OUT_OF_RESOURCES; } diff --git a/Drivers/UsbKbDxe/KeyBoard.c b/Drivers/UsbKbDxe/KeyBoard.c index d9ab2fc3e..493abc4a9 100644 --- a/Drivers/UsbKbDxe/KeyBoard.c +++ b/Drivers/UsbKbDxe/KeyBoard.c @@ -619,7 +619,7 @@ SetKeyboardLayoutEvent ( // Re-allocate resource for KeyConvertionTable // ReleaseKeyboardLayoutResources (UsbKeyboardDevice); - UsbKeyboardDevice->KeyConvertionTable = AllocateZeroPool ((NUMBER_OF_VALID_USB_KEYCODE) * sizeof (EFI_KEY_DESCRIPTOR)); + UsbKeyboardDevice->KeyConvertionTable = AllocateZeroPool((NUMBER_OF_VALID_USB_KEYCODE) * sizeof (EFI_KEY_DESCRIPTOR)); ASSERT (UsbKeyboardDevice->KeyConvertionTable != NULL); // @@ -648,7 +648,7 @@ SetKeyboardLayoutEvent ( // For non-spacing key, create the list with a non-spacing key followed by physical keys. // if (TempKey.Modifier == EFI_NS_KEY_MODIFIER) { - UsbNsKey = AllocateZeroPool (sizeof (USB_NS_KEY)); + UsbNsKey = AllocateZeroPool(sizeof (USB_NS_KEY)); ASSERT (UsbNsKey != NULL); // @@ -746,7 +746,7 @@ InitKeyboardLayout ( EFI_HII_KEYBOARD_LAYOUT *KeyboardLayout; EFI_STATUS Status; - UsbKeyboardDevice->KeyConvertionTable = AllocateZeroPool ((NUMBER_OF_VALID_USB_KEYCODE) * sizeof (EFI_KEY_DESCRIPTOR)); + UsbKeyboardDevice->KeyConvertionTable = AllocateZeroPool((NUMBER_OF_VALID_USB_KEYCODE) * sizeof (EFI_KEY_DESCRIPTOR)); ASSERT (UsbKeyboardDevice->KeyConvertionTable != NULL); InitializeListHead (&UsbKeyboardDevice->NsKeyList); diff --git a/Drivers/UsbMouseDxe/UsbMouse.c b/Drivers/UsbMouseDxe/UsbMouse.c index d941104f3..ef2271b90 100644 --- a/Drivers/UsbMouseDxe/UsbMouse.c +++ b/Drivers/UsbMouseDxe/UsbMouse.c @@ -193,7 +193,7 @@ USBMouseDriverBindingStart ( DBG("UsbMouse started\n"); - UsbMouseDevice = AllocateZeroPool (sizeof (USB_MOUSE_DEV)); + UsbMouseDevice = AllocateZeroPool(sizeof (USB_MOUSE_DEV)); ASSERT (UsbMouseDevice != NULL); UsbMouseDevice->UsbIo = UsbIo; @@ -620,7 +620,7 @@ InitializeUsbMouseDevice ( // By issuing Get_Descriptor(Configuration) request with total length, we get the Configuration descriptor, // all Interface descriptors, all Endpoint descriptors, and the HID descriptor for each interface. // - Buf = AllocateZeroPool (ConfigDesc.TotalLength); + Buf = AllocateZeroPool(ConfigDesc.TotalLength); if (Buf == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -681,7 +681,7 @@ InitializeUsbMouseDevice ( return EFI_UNSUPPORTED; } - ReportDesc = AllocateZeroPool (MouseHidDesc->HidClassDesc[0].DescriptorLength); + ReportDesc = AllocateZeroPool(MouseHidDesc->HidClassDesc[0].DescriptorLength); ASSERT (ReportDesc != NULL); Status = UsbGetReportDescriptor ( diff --git a/Drivers/XhciDxe/UsbHcMem.c b/Drivers/XhciDxe/UsbHcMem.c index a34d96a3e..9099dedd8 100644 --- a/Drivers/XhciDxe/UsbHcMem.c +++ b/Drivers/XhciDxe/UsbHcMem.c @@ -42,7 +42,7 @@ UsbHcAllocMemBlock ( PciIo = Pool->PciIo; - Block = AllocateZeroPool (sizeof (USBHC_MEM_BLOCK)); + Block = AllocateZeroPool(sizeof (USBHC_MEM_BLOCK)); if (Block == NULL) { return NULL; } @@ -55,7 +55,7 @@ UsbHcAllocMemBlock ( Block->BufLen = EFI_PAGES_TO_SIZE (Pages); Block->BitsLen = Block->BufLen / (USBHC_MEM_UNIT * 8); - Block->Bits = AllocateZeroPool (Block->BitsLen); + Block->Bits = AllocateZeroPool(Block->BitsLen); if (Block->Bits == NULL) { gBS->FreePool(Block); diff --git a/Drivers/XhciDxe/Xhci.c b/Drivers/XhciDxe/Xhci.c index 0410e66f0..4d2bc13c0 100644 --- a/Drivers/XhciDxe/Xhci.c +++ b/Drivers/XhciDxe/Xhci.c @@ -1060,7 +1060,7 @@ XhcControlTransfer ( } else { MaxPacket0 = Xhc->UsbDevContext[SlotId].DevDesc.MaxPacketSize0; } - Xhc->UsbDevContext[SlotId].ConfDesc = AllocateZeroPool (Xhc->UsbDevContext[SlotId].DevDesc.NumConfigurations * sizeof (EFI_USB_CONFIG_DESCRIPTOR *)); + Xhc->UsbDevContext[SlotId].ConfDesc = AllocateZeroPool(Xhc->UsbDevContext[SlotId].DevDesc.NumConfigurations * sizeof (EFI_USB_CONFIG_DESCRIPTOR *)); if (Xhc->HcCParams.Data.Csz == 0) { Status = XhcEvaluateContext (Xhc, SlotId, MaxPacket0); } else { @@ -1087,7 +1087,7 @@ XhcControlTransfer ( // // Default to use AlternateSetting 0 for all interfaces. // - Xhc->UsbDevContext[SlotId].ActiveAlternateSetting = AllocateZeroPool (Xhc->UsbDevContext[SlotId].ConfDesc[Index]->NumInterfaces * sizeof (UINT8)); + Xhc->UsbDevContext[SlotId].ActiveAlternateSetting = AllocateZeroPool(Xhc->UsbDevContext[SlotId].ConfDesc[Index]->NumInterfaces * sizeof (UINT8)); } } else if (((DescriptorType == USB_DESC_TYPE_HUB) || (DescriptorType == USB_DESC_TYPE_HUB_SUPER_SPEED)) && (*DataLength > 2)) { @@ -1486,7 +1486,7 @@ XhcAsyncInterruptTransfer ( goto ON_EXIT; } - Data = AllocateZeroPool (DataLength); + Data = AllocateZeroPool(DataLength); if (Data == NULL) { // DEBUG ((EFI_D_ERROR, "XhcAsyncInterruptTransfer: failed to allocate buffer\n")); @@ -1855,7 +1855,7 @@ XhcCreateUsbHc ( UINT32 PageSize; UINT16 ExtCapReg; - Xhc = AllocateZeroPool (sizeof (USB_XHCI_INSTANCE)); + Xhc = AllocateZeroPool(sizeof (USB_XHCI_INSTANCE)); if (Xhc == NULL) { return NULL; diff --git a/Drivers/XhciDxe/XhciSched.c b/Drivers/XhciDxe/XhciSched.c index 77ca884aa..744ef942d 100644 --- a/Drivers/XhciDxe/XhciSched.c +++ b/Drivers/XhciDxe/XhciSched.c @@ -32,7 +32,7 @@ XhcCreateCmdTrb ( { URB *Urb; - Urb = AllocateZeroPool (sizeof (URB)); + Urb = AllocateZeroPool(sizeof (URB)); if (Urb == NULL) { return NULL; } @@ -152,7 +152,7 @@ XhcCreateUrb ( EFI_STATUS Status; URB *Urb; - Urb = AllocateZeroPool (sizeof (URB)); + Urb = AllocateZeroPool(sizeof (URB)); if (Urb == NULL) { return NULL; } @@ -535,7 +535,7 @@ XhcInitSched ( // // Allocate the buffer to record the Mapping for each scratch buffer in order to Unmap them // - ScratchEntryMap = AllocateZeroPool (sizeof (UINTN) * MaxScratchpadBufs); + ScratchEntryMap = AllocateZeroPool(sizeof (UINTN) * MaxScratchpadBufs); // ASSERT (ScratchEntryMap != NULL); if (!ScratchEntryMap) { return; @@ -545,7 +545,7 @@ XhcInitSched ( // // Allocate the buffer to record the host address for each entry // - ScratchEntry = AllocateZeroPool (sizeof (UINT64) * MaxScratchpadBufs); + ScratchEntry = AllocateZeroPool(sizeof (UINT64) * MaxScratchpadBufs); // ASSERT (ScratchEntry != NULL); if (!ScratchEntry) { return; @@ -1622,7 +1622,7 @@ XhcMonitorAsyncRequests ( continue; } - ProcBuf = AllocateZeroPool (Urb->Completed); + ProcBuf = AllocateZeroPool(Urb->Completed); if (ProcBuf == NULL) { XhcUpdateAsyncRequest (Xhc, Urb); @@ -2197,7 +2197,7 @@ XhcInitializeDeviceSlot ( // // 4) Allocate and initialize the Transfer Ring for the Default Control Endpoint. // - EndpointTransferRing = AllocateZeroPool (sizeof (TRANSFER_RING)); + EndpointTransferRing = AllocateZeroPool(sizeof (TRANSFER_RING)); Xhc->UsbDevContext[SlotId].EndpointTransferRing[0] = EndpointTransferRing; CreateTransferRing(Xhc, TR_RING_TRB_NUMBER, (TRANSFER_RING *)Xhc->UsbDevContext[SlotId].EndpointTransferRing[0]); // @@ -2422,7 +2422,7 @@ XhcInitializeDeviceSlot64 ( // // 4) Allocate and initialize the Transfer Ring for the Default Control Endpoint. // - EndpointTransferRing = AllocateZeroPool (sizeof (TRANSFER_RING)); + EndpointTransferRing = AllocateZeroPool(sizeof (TRANSFER_RING)); Xhc->UsbDevContext[SlotId].EndpointTransferRing[0] = EndpointTransferRing; CreateTransferRing(Xhc, TR_RING_TRB_NUMBER, (TRANSFER_RING *)Xhc->UsbDevContext[SlotId].EndpointTransferRing[0]); // diff --git a/FileSystems/ApfsDriverLoader/ApfsDriverLoader.c b/FileSystems/ApfsDriverLoader/ApfsDriverLoader.c index cb84bfa54..2f3582740 100644 --- a/FileSystems/ApfsDriverLoader/ApfsDriverLoader.c +++ b/FileSystems/ApfsDriverLoader/ApfsDriverLoader.c @@ -162,7 +162,7 @@ StartApfsDriver ( // // Patch verbose // - NewSystemTable = (EFI_SYSTEM_TABLE *) AllocateZeroPool (gST->Hdr.HeaderSize); + NewSystemTable = (EFI_SYSTEM_TABLE *) AllocateZeroPool(gST->Hdr.HeaderSize); if (NewSystemTable == NULL) { gBS->UnloadImage (ImageHandle); @@ -340,7 +340,7 @@ LegacyApfsContainerScan ( } - Block = AllocateZeroPool ((UINTN)BlockSize); + Block = AllocateZeroPool((UINTN)BlockSize); if (Block == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -381,7 +381,7 @@ LegacyApfsContainerScan ( // Reallocate Block size to contain all of partition entries. // FreePool(Block); - Block = AllocateZeroPool ((UINTN)PartitionNumber * PartitionEntrySize); + Block = AllocateZeroPool((UINTN)PartitionNumber * PartitionEntrySize); if (Block == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -725,7 +725,7 @@ ApfsDriverLoaderStart ( MediaId = BlockIo->Media->MediaId; } - ApfsBlock = AllocateZeroPool (2048); + ApfsBlock = AllocateZeroPool(2048); if (ApfsBlock == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -803,7 +803,7 @@ ApfsDriverLoaderStart ( // ContainerSuperBlock (& EfiBootRecordBlockPtr ?) will not valid now // FreePool(ApfsBlock); - ApfsBlock = AllocateZeroPool (ApfsBlockSize); + ApfsBlock = AllocateZeroPool(ApfsBlockSize); if (ApfsBlock == NULL) { return EFI_OUT_OF_RESOURCES; } diff --git a/FileSystems/FatPkg/EnhancedFatDxe/DirectoryCache.c b/FileSystems/FatPkg/EnhancedFatDxe/DirectoryCache.c index 5c9020e19..6628a74f3 100644 --- a/FileSystems/FatPkg/EnhancedFatDxe/DirectoryCache.c +++ b/FileSystems/FatPkg/EnhancedFatDxe/DirectoryCache.c @@ -82,7 +82,7 @@ Returns: { FAT_ODIR *ODir; - ODir = AllocateZeroPool (sizeof (FAT_ODIR)); + ODir = AllocateZeroPool(sizeof (FAT_ODIR)); if (ODir != NULL) { // // Initialize the directory entry list diff --git a/FileSystems/FatPkg/EnhancedFatDxe/DirectoryManage.c b/FileSystems/FatPkg/EnhancedFatDxe/DirectoryManage.c index 6a86edd59..1a94b9f48 100644 --- a/FileSystems/FatPkg/EnhancedFatDxe/DirectoryManage.c +++ b/FileSystems/FatPkg/EnhancedFatDxe/DirectoryManage.c @@ -465,7 +465,7 @@ Returns: // // This is a valid directory entry // - DirEnt = AllocateZeroPool (sizeof (FAT_DIRENT)); + DirEnt = AllocateZeroPool(sizeof (FAT_DIRENT)); if (DirEnt == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -1197,7 +1197,7 @@ Returns: return EFI_NOT_FOUND; } ODir = OFile->ODir; - DirEnt = AllocateZeroPool (sizeof (FAT_DIRENT)); + DirEnt = AllocateZeroPool(sizeof (FAT_DIRENT)); if (DirEnt == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -1307,7 +1307,7 @@ Returns: // // Open the directory entry // - OFile = AllocateZeroPool (sizeof (FAT_OFILE)); + OFile = AllocateZeroPool(sizeof (FAT_OFILE)); if (OFile == NULL) { return EFI_OUT_OF_RESOURCES; } diff --git a/FileSystems/FatPkg/EnhancedFatDxe/DiskCache.c b/FileSystems/FatPkg/EnhancedFatDxe/DiskCache.c index 2b52b8584..5a6a54a5b 100644 --- a/FileSystems/FatPkg/EnhancedFatDxe/DiskCache.c +++ b/FileSystems/FatPkg/EnhancedFatDxe/DiskCache.c @@ -528,7 +528,7 @@ Returns: // // Allocate the Fat Cache buffer // - CacheBuffer = AllocateZeroPool (FatCacheSize + DataCacheSize); + CacheBuffer = AllocateZeroPool(FatCacheSize + DataCacheSize); if (CacheBuffer == NULL) { return EFI_OUT_OF_RESOURCES; } diff --git a/FileSystems/FatPkg/EnhancedFatDxe/Init.c b/FileSystems/FatPkg/EnhancedFatDxe/Init.c index 7ead389e0..1227dedf9 100644 --- a/FileSystems/FatPkg/EnhancedFatDxe/Init.c +++ b/FileSystems/FatPkg/EnhancedFatDxe/Init.c @@ -52,7 +52,7 @@ Returns: // // Allocate a volume structure // - Volume = AllocateZeroPool (sizeof (FAT_VOLUME)); + Volume = AllocateZeroPool(sizeof (FAT_VOLUME)); if (Volume == NULL) { return EFI_OUT_OF_RESOURCES; } diff --git a/FileSystems/FatPkg/EnhancedFatDxe/Misc.c b/FileSystems/FatPkg/EnhancedFatDxe/Misc.c index e696e05cd..f205d84e8 100644 --- a/FileSystems/FatPkg/EnhancedFatDxe/Misc.c +++ b/FileSystems/FatPkg/EnhancedFatDxe/Misc.c @@ -42,7 +42,7 @@ Return: { FAT_TASK *Task; - Task = AllocateZeroPool (sizeof (*Task)); + Task = AllocateZeroPool(sizeof (*Task)); if (Task != NULL) { Task->Signature = FAT_TASK_SIGNATURE; Task->IFile = IFile; @@ -398,7 +398,7 @@ Returns: // // Non-blocking access // - Subtask = AllocateZeroPool (sizeof (*Subtask)); + Subtask = AllocateZeroPool(sizeof (*Subtask)); if (Subtask == NULL) { Status = EFI_OUT_OF_RESOURCES; } else { diff --git a/FileSystems/FatPkg/EnhancedFatDxe/Open.c b/FileSystems/FatPkg/EnhancedFatDxe/Open.c index 03a5092fa..40218de10 100644 --- a/FileSystems/FatPkg/EnhancedFatDxe/Open.c +++ b/FileSystems/FatPkg/EnhancedFatDxe/Open.c @@ -51,7 +51,7 @@ Returns: // // Allocate a new open instance // - IFile = AllocateZeroPool (sizeof (FAT_IFILE)); + IFile = AllocateZeroPool(sizeof (FAT_IFILE)); if (IFile == NULL) { return EFI_OUT_OF_RESOURCES; } diff --git a/FileSystems/FatPkg/EnhancedFatDxe/ReadWrite.c b/FileSystems/FatPkg/EnhancedFatDxe/ReadWrite.c index 86de5f8ab..70bf75fa3 100644 --- a/FileSystems/FatPkg/EnhancedFatDxe/ReadWrite.c +++ b/FileSystems/FatPkg/EnhancedFatDxe/ReadWrite.c @@ -652,7 +652,7 @@ Returns: BufferSize = FAT_MAX_ALLOCATE_SIZE; } - ZeroBuffer = AllocateZeroPool (BufferSize); + ZeroBuffer = AllocateZeroPool(BufferSize); if (ZeroBuffer == NULL) { return EFI_OUT_OF_RESOURCES; } diff --git a/LegacyBios/KeyboardDxe/BiosKeyboard.c b/LegacyBios/KeyboardDxe/BiosKeyboard.c index f77df091a..0fb48967b 100644 --- a/LegacyBios/KeyboardDxe/BiosKeyboard.c +++ b/LegacyBios/KeyboardDxe/BiosKeyboard.c @@ -250,7 +250,7 @@ BiosKeyboardDriverBindingStart ( // // Allocate the private device structure // - BiosKeyboardPrivate = (BIOS_KEYBOARD_DEV *) AllocateZeroPool (sizeof (BIOS_KEYBOARD_DEV)); + BiosKeyboardPrivate = (BIOS_KEYBOARD_DEV *) AllocateZeroPool(sizeof (BIOS_KEYBOARD_DEV)); if (NULL == BiosKeyboardPrivate) { Status = EFI_OUT_OF_RESOURCES; goto Done; @@ -2341,7 +2341,7 @@ BiosKeyboardRegisterKeyNotify ( // Allocate resource to save the notification function // - NewNotify = (BIOS_KEYBOARD_CONSOLE_IN_EX_NOTIFY *) AllocateZeroPool (sizeof (BIOS_KEYBOARD_CONSOLE_IN_EX_NOTIFY)); + NewNotify = (BIOS_KEYBOARD_CONSOLE_IN_EX_NOTIFY *) AllocateZeroPool(sizeof (BIOS_KEYBOARD_CONSOLE_IN_EX_NOTIFY)); if (NewNotify == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Exit; diff --git a/LegacyBios/VideoDxe/BiosVideo.c b/LegacyBios/VideoDxe/BiosVideo.c index c6a924881..dd72fb0e0 100644 --- a/LegacyBios/VideoDxe/BiosVideo.c +++ b/LegacyBios/VideoDxe/BiosVideo.c @@ -632,7 +632,7 @@ BiosVideoChildHandleInstall ( // // Allocate the private device structure for video device // - BiosVideoPrivate = (BIOS_VIDEO_DEV *) AllocateZeroPool (sizeof (BIOS_VIDEO_DEV)); + BiosVideoPrivate = (BIOS_VIDEO_DEV *) AllocateZeroPool(sizeof (BIOS_VIDEO_DEV)); if (NULL == BiosVideoPrivate) { Status = EFI_OUT_OF_RESOURCES; goto Done; diff --git a/LegacyBios/VideoDxe/BiosVideo2.c b/LegacyBios/VideoDxe/BiosVideo2.c index 700eeff25..b845019d8 100644 --- a/LegacyBios/VideoDxe/BiosVideo2.c +++ b/LegacyBios/VideoDxe/BiosVideo2.c @@ -637,7 +637,7 @@ BiosVideoChildHandleInstall ( // // Allocate the private device structure for video device // - BiosVideoPrivate = (BIOS_VIDEO_DEV *) AllocateZeroPool (sizeof (BIOS_VIDEO_DEV)); + BiosVideoPrivate = (BIOS_VIDEO_DEV *) AllocateZeroPool(sizeof (BIOS_VIDEO_DEV)); if (NULL == BiosVideoPrivate) { Status = EFI_OUT_OF_RESOURCES; goto Done; diff --git a/Library/DeviceTreeLib/DeviceTreeLib.c b/Library/DeviceTreeLib/DeviceTreeLib.c index 92d40c9b6..9ab961773 100755 --- a/Library/DeviceTreeLib/DeviceTreeLib.c +++ b/Library/DeviceTreeLib/DeviceTreeLib.c @@ -687,7 +687,7 @@ DTInsertProperty ( // // Insert Property Name. // - CopyMem (Property->Name, AddPropertyName, AsciiStrLen (AddPropertyName)); + CopyMem (Property->Name, AddPropertyName, AsciiStrLen(AddPropertyName)); // // Insert Property Value Length. diff --git a/Library/GenericBdsLib/BdsBoot.c b/Library/GenericBdsLib/BdsBoot.c index bbcc955fb..69de094dc 100644 --- a/Library/GenericBdsLib/BdsBoot.c +++ b/Library/GenericBdsLib/BdsBoot.c @@ -351,8 +351,8 @@ BdsCreateLegacyBootOption ( // UnicodeStrToAsciiStrS (BootDesc, HelpString, 100); - StringLen = AsciiStrLen (HelpString); - NewBbsDevPathNode = AllocateZeroPool (sizeof (BBS_BBS_DEVICE_PATH) + StringLen); + StringLen = AsciiStrLen(HelpString); + NewBbsDevPathNode = AllocateZeroPool(sizeof (BBS_BBS_DEVICE_PATH) + StringLen); if (NewBbsDevPathNode == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -381,7 +381,7 @@ BdsCreateLegacyBootOption ( sizeof (BBS_TABLE) + sizeof (UINT16); - Buffer = AllocateZeroPool (BufferSize); + Buffer = AllocateZeroPool(BufferSize); if (Buffer == NULL) { FreePool(NewBbsDevPathNode); FreePool(CurrentBbsDevPath); @@ -431,7 +431,7 @@ BdsCreateLegacyBootOption ( Buffer = NULL; - NewBootOrderList = AllocateZeroPool (*BootOrderListSize + sizeof (UINT16)); + NewBootOrderList = AllocateZeroPool(*BootOrderListSize + sizeof (UINT16)); if (NULL == NewBootOrderList) { FreePool(NewBbsDevPathNode); FreePool(CurrentBbsDevPath); @@ -1025,7 +1025,7 @@ BdsCreateDevOrder ( // // Create buffer to hold all boot device order // - DevOrder = AllocateZeroPool (TotalSize); + DevOrder = AllocateZeroPool(TotalSize); if (NULL == DevOrder) { return EFI_OUT_OF_RESOURCES; } @@ -1198,7 +1198,7 @@ BdsUpdateLegacyDevOrder ( TotalSize += (HeaderSize + NETCount * sizeof (UINT16)); TotalSize += (HeaderSize + BEVCount * sizeof (UINT16)); - NewDevOrder = AllocateZeroPool (TotalSize); + NewDevOrder = AllocateZeroPool(TotalSize); if (NULL == NewDevOrder) { return EFI_OUT_OF_RESOURCES; } @@ -2355,7 +2355,7 @@ BdsLibBootViaBootOption ( if (Option->DevicePath != NULL) { FreePool(Option->DevicePath); } - Option->DevicePath = AllocateZeroPool (GetDevicePathSize (DevicePath)); + Option->DevicePath = AllocateZeroPool(GetDevicePathSize (DevicePath)); // ASSERT(Option->DevicePath != NULL); if (!Option->DevicePath) { return EFI_OUT_OF_RESOURCES; diff --git a/Library/GenericBdsLib/BdsConsole.c b/Library/GenericBdsLib/BdsConsole.c index 578e17ead..2ff684c41 100644 --- a/Library/GenericBdsLib/BdsConsole.c +++ b/Library/GenericBdsLib/BdsConsole.c @@ -1246,7 +1246,7 @@ Done: return EFI_UNSUPPORTED; } - LogoBlt = AllocateZeroPool ((UINTN)BufferSize * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)); + LogoBlt = AllocateZeroPool((UINTN)BufferSize * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)); if (LogoBlt == NULL) { return EFI_OUT_OF_RESOURCES; } diff --git a/Library/GenericBdsLib/BdsMisc.c b/Library/GenericBdsLib/BdsMisc.c index 144386fc3..730d575ae 100644 --- a/Library/GenericBdsLib/BdsMisc.c +++ b/Library/GenericBdsLib/BdsMisc.c @@ -305,7 +305,7 @@ BdsLibRegisterNewOption ( OptionSize = sizeof (UINT32) + sizeof (UINT16) + StrSize (String); OptionSize += GetDevicePathSize (DevicePath); - OptionPtr = AllocateZeroPool (OptionSize); + OptionPtr = AllocateZeroPool(OptionSize); // ASSERT (OptionPtr != NULL); if (!OptionPtr) { return EFI_OUT_OF_RESOURCES; @@ -396,7 +396,7 @@ BdsLibRegisterNewOption ( // Append the new option number to the original option order // OrderItemNum = (TempOptionSize / sizeof (UINT16)) + 1 ; - OptionOrderPtr = AllocateZeroPool ( OrderItemNum * sizeof (UINT16)); + OptionOrderPtr = AllocateZeroPool( OrderItemNum * sizeof (UINT16)); // ASSERT (OptionOrderPtr!= NULL); if (!OptionOrderPtr) { return EFI_NOT_FOUND; @@ -693,7 +693,7 @@ BdsLibVariableToOption ( // The Console variables may have multiple device paths, so make // an Entry for each one. // - Option = AllocateZeroPool (sizeof (BDS_COMMON_OPTION)); + Option = AllocateZeroPool(sizeof (BDS_COMMON_OPTION)); if (Option == NULL) { FreePool(Variable); return NULL; @@ -860,7 +860,7 @@ BdsLibGetVariableAndSize ( // // Allocate the buffer to return // - Buffer = AllocateZeroPool (BufferSize); + Buffer = AllocateZeroPool(BufferSize); if (Buffer == NULL) { *VariableSize = 0; return NULL; @@ -1157,12 +1157,12 @@ SetupResetReminder ( if (IsResetReminderFeatureEnable ()) { if (IsResetRequired ()) { - StringBuffer1 = AllocateZeroPool (MAX_STRING_LEN * sizeof (CHAR16)); + StringBuffer1 = AllocateZeroPool(MAX_STRING_LEN * sizeof (CHAR16)); // ASSERT (StringBuffer1 != NULL); if (!StringBuffer1) { return; } - StringBuffer2 = AllocateZeroPool (MAX_STRING_LEN * sizeof (CHAR16)); + StringBuffer2 = AllocateZeroPool(MAX_STRING_LEN * sizeof (CHAR16)); // ASSERT (StringBuffer2 != NULL); if (!StringBuffer2) { FreePool(StringBuffer1); diff --git a/Library/GenericBdsLib/DevicePath.c b/Library/GenericBdsLib/DevicePath.c index d27c71d82..a422a84b4 100644 --- a/Library/GenericBdsLib/DevicePath.c +++ b/Library/GenericBdsLib/DevicePath.c @@ -90,7 +90,7 @@ CatPrint ( VA_LIST Args; UINTN StringSize; - AppendStr = AllocateZeroPool (0x1000); + AppendStr = AllocateZeroPool(0x1000); if (AppendStr == NULL) { return Str->Str; } @@ -100,7 +100,7 @@ CatPrint ( VA_END (Args); if (NULL == Str->Str) { StringSize = StrSize (AppendStr); - Str->Str = AllocateZeroPool (StringSize); + Str->Str = AllocateZeroPool(StringSize); // ASSERT (Str->Str != NULL); } else { StringSize = StrSize (AppendStr); diff --git a/Library/GenericBdsLib/Performance.c b/Library/GenericBdsLib/Performance.c index 1989284f4..e8da7816c 100644 --- a/Library/GenericBdsLib/Performance.c +++ b/Library/GenericBdsLib/Performance.c @@ -289,7 +289,7 @@ WriteBootToOsPerformanceData ( &EndTicker)) != 0) { NumPerfEntries++; } - PerfEntriesAsDxeHandle = AllocateZeroPool (NumPerfEntries * sizeof (BOOLEAN)); + PerfEntriesAsDxeHandle = AllocateZeroPool(NumPerfEntries * sizeof (BOOLEAN)); // ASSERT (PerfEntriesAsDxeHandle != NULL); // diff --git a/Library/MachoLib/CxxSymbols.c b/Library/MachoLib/CxxSymbols.c index 09bafa5b0..f9cc5963a 100644 --- a/Library/MachoLib/CxxSymbols.c +++ b/Library/MachoLib/CxxSymbols.c @@ -173,7 +173,7 @@ MachoGetClassNameFromSuperMetaClassPointer ( PrefixSize = L_STR_LEN (OSOBJ_PREFIX); SuffixSize = L_STR_LEN (SMCP_TOKEN); - OutputSize = (AsciiStrLen (SmcpName) - PrefixSize - SuffixSize); + OutputSize = (AsciiStrLen(SmcpName) - PrefixSize - SuffixSize); if ((OutputSize + 1) > ClassNameSize) { return FALSE; @@ -288,7 +288,7 @@ MachoGetClassNameFromMetaClassPointer ( PrefixSize = L_STR_LEN (OSOBJ_PREFIX); SuffixSize = L_STR_LEN (METACLASS_TOKEN); - ClassNameLength = (AsciiStrLen (MetaClassName) - PrefixSize - SuffixSize); + ClassNameLength = (AsciiStrLen(MetaClassName) - PrefixSize - SuffixSize); if ((ClassNameLength + 1) > ClassNameSize) { return FALSE; } @@ -375,7 +375,7 @@ MachoGetMetaVtableNameFromClassName ( ASSERT (VtableNameSize > 0); ASSERT (VtableName != NULL); - BodyLength = AsciiStrLen (ClassName); + BodyLength = AsciiStrLen(ClassName); Result = OcOverflowTriAddUN ( L_STR_LEN (METACLASS_VTABLE_PREFIX), @@ -433,7 +433,7 @@ MachoGetFinalSymbolNameFromClassName ( ASSERT (FinalSymbolNameSize > 0); ASSERT (FinalSymbolName != NULL); - BodyLength = AsciiStrLen (ClassName); + BodyLength = AsciiStrLen(ClassName); Result = OcOverflowTriAddUN ( L_STR_LEN (OSOBJ_PREFIX), diff --git a/Library/MemLogLibDefault/MemLogLib.c b/Library/MemLogLibDefault/MemLogLib.c index 260ef3d06..2cd62125c 100644 --- a/Library/MemLogLibDefault/MemLogLib.c +++ b/Library/MemLogLibDefault/MemLogLib.c @@ -123,12 +123,12 @@ MemLogInit ( // // Set up and publish new MEM_LOG // - mMemLog = AllocateZeroPool ( sizeof (MEM_LOG) ); + mMemLog = AllocateZeroPool( sizeof (MEM_LOG) ); if (mMemLog == NULL) { return EFI_OUT_OF_RESOURCES; } mMemLog->BufferSize = MEM_LOG_INITIAL_SIZE; - mMemLog->Buffer = AllocateZeroPool (MEM_LOG_INITIAL_SIZE); + mMemLog->Buffer = AllocateZeroPool(MEM_LOG_INITIAL_SIZE); mMemLog->Cursor = mMemLog->Buffer; mMemLog->Callback = NULL; diff --git a/Library/OcGuardLib/Ubsan.h b/Library/OcGuardLib/Ubsan.h index 5a01a2305..1e34ef0f6 100644 --- a/Library/OcGuardLib/Ubsan.h +++ b/Library/OcGuardLib/Ubsan.h @@ -201,8 +201,8 @@ int EFIAPI tfp_sprintf(char *str, const char *fmt, ...) __printflike(2, 3); #define memcpy(Dst, Src, Size) do { CopyMem(Dst, Src, Size); } while (0) // Forcing VOID for those as the return types actually differ. -#define strlcpy(Dst, Src, Size) do { AsciiStrnCpyS (Dst, Size, Src, AsciiStrLen (Src)); } while (0) -#define strlcat(Dst, Src, Size) do { AsciiStrnCatS (Dst, Size, Src, AsciiStrLen (Src)); } while (0) +#define strlcpy(Dst, Src, Size) do { AsciiStrnCpyS (Dst, Size, Src, AsciiStrLen(Src)); } while (0) +#define strlcat(Dst, Src, Size) do { AsciiStrnCatS (Dst, Size, Src, AsciiStrLen(Src)); } while (0) #endif // UBSAN_H diff --git a/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenu.c b/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenu.c index c98ea0aa2..e6559f774 100644 --- a/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenu.c +++ b/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenu.c @@ -305,7 +305,7 @@ InitializeBootMenuData ( } BootMenuData->TitleToken[0] = STRING_TOKEN (STR_BOOT_POPUP_MENU_TITLE_STRING); - BootMenuData->PtrTokens = AllocateZeroPool (BootOptionCount * sizeof (EFI_STRING_ID)); + BootMenuData->PtrTokens = AllocateZeroPool(BootOptionCount * sizeof (EFI_STRING_ID)); ASSERT (BootMenuData->PtrTokens != NULL); // @@ -430,7 +430,7 @@ BootMenuSelectItem ( // PrintCol = StartCol + 1; PrintRow = StartRow + TITLE_TOKEN_COUNT + 2; - String = AllocateZeroPool ((BootMenuData->MenuScreen.Width - 2) * sizeof (CHAR16)); + String = AllocateZeroPool((BootMenuData->MenuScreen.Width - 2) * sizeof (CHAR16)); ASSERT (String != NULL); for (Index = 0; Index < BootMenuData->MenuScreen.Width - 3; Index++) { String[Index] = 0x20; @@ -526,7 +526,7 @@ DrawBootPopupMenu ( // // Draw the screen for title // - String = AllocateZeroPool ((Width - 1) * sizeof (CHAR16)); + String = AllocateZeroPool((Width - 1) * sizeof (CHAR16)); ASSERT (String != NULL); for (Index = 0; Index < Width - 2; Index++) { String[Index] = 0x20; diff --git a/MdeModulePkg/Application/CapsuleApp/AppSupport.c b/MdeModulePkg/Application/CapsuleApp/AppSupport.c index ed9bb2e75..cca97042f 100644 --- a/MdeModulePkg/Application/CapsuleApp/AppSupport.c +++ b/MdeModulePkg/Application/CapsuleApp/AppSupport.c @@ -118,7 +118,7 @@ ReadFileToBuffer ( } TempBufferSize = (UINTN) FileSize; - TempBuffer = AllocateZeroPool (TempBufferSize); + TempBuffer = AllocateZeroPool(TempBufferSize); if (TempBuffer == NULL) { ShellProtocol->CloseFile (Handle); return EFI_OUT_OF_RESOURCES; diff --git a/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c b/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c index 4a862bacc..cb2174ce4 100644 --- a/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c +++ b/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c @@ -744,7 +744,7 @@ DumpCapsuleFromDisk ( goto Done; } - FileInfoBuffer = AllocateZeroPool (sizeof (FileInfo) * FileCount); + FileInfoBuffer = AllocateZeroPool(sizeof (FileInfo) * FileCount); if (FileInfoBuffer == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Done; @@ -1148,7 +1148,7 @@ DumpFmpData ( } FmpImageInfoBuf = NULL; - FmpImageInfoBuf = AllocateZeroPool (ImageInfoSize); + FmpImageInfoBuf = AllocateZeroPool(ImageInfoSize); if (FmpImageInfoBuf == NULL) { Status = EFI_OUT_OF_RESOURCES; goto EXIT; @@ -1323,7 +1323,7 @@ FindFmpFromImageTypeId ( } FmpImageInfoBuf = NULL; - FmpImageInfoBuf = AllocateZeroPool (ImageInfoSize); + FmpImageInfoBuf = AllocateZeroPool(ImageInfoSize); if (FmpImageInfoBuf == NULL) { FreePool(HandleBuffer); Print(L"Out of resource\n"); diff --git a/MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.c b/MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.c index 46923842e..15f4a2a59 100644 --- a/MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.c +++ b/MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.c @@ -1052,10 +1052,10 @@ GetUefiMemoryProfileData ( goto Done; } - Data = AllocateZeroPool ((UINTN) Size); + Data = AllocateZeroPool((UINTN) Size); if (Data == NULL) { Status = EFI_OUT_OF_RESOURCES; - Print (L"UefiMemoryProfile: AllocateZeroPool (0x%x) - %r\n", Size, Status); + Print (L"UefiMemoryProfile: AllocateZeroPool(0x%x) - %r\n", Size, Status); return Status; } @@ -1245,10 +1245,10 @@ GetSmramProfileData ( // // Get Data // - ProfileBuffer = AllocateZeroPool (ProfileSize); + ProfileBuffer = AllocateZeroPool(ProfileSize); if (ProfileBuffer == NULL) { Status = EFI_OUT_OF_RESOURCES; - Print (L"SmramProfile: AllocateZeroPool (0x%x) for profile buffer - %r\n", ProfileSize, Status); + Print (L"SmramProfile: AllocateZeroPool(0x%x) for profile buffer - %r\n", ProfileSize, Status); goto Done; } diff --git a/MdeModulePkg/Application/SmiHandlerProfileInfo/SmiHandlerProfileInfo.c b/MdeModulePkg/Application/SmiHandlerProfileInfo/SmiHandlerProfileInfo.c index e2cc9ebb8..2f8ba80bc 100644 --- a/MdeModulePkg/Application/SmiHandlerProfileInfo/SmiHandlerProfileInfo.c +++ b/MdeModulePkg/Application/SmiHandlerProfileInfo/SmiHandlerProfileInfo.c @@ -136,7 +136,7 @@ GetSmiHandlerProfileDatabase( mSmiHandlerProfileDatabase = AllocateZeroPool(mSmiHandlerProfileDatabaseSize); if (mSmiHandlerProfileDatabase == NULL) { Status = EFI_OUT_OF_RESOURCES; - Print(L"SmiHandlerProfile: AllocateZeroPool (0x%x) for dump buffer - %r\n", mSmiHandlerProfileDatabaseSize, Status); + Print(L"SmiHandlerProfile: AllocateZeroPool(0x%x) for dump buffer - %r\n", mSmiHandlerProfileDatabaseSize, Status); return ; } diff --git a/MdeModulePkg/Application/UiApp/FrontPage.c b/MdeModulePkg/Application/UiApp/FrontPage.c index 0973aa3ff..b693b5cee 100644 --- a/MdeModulePkg/Application/UiApp/FrontPage.c +++ b/MdeModulePkg/Application/UiApp/FrontPage.c @@ -402,7 +402,7 @@ ConvertProcessorToString ( FreqMhz = 0; } DestMax = 0x20 / sizeof (CHAR16); - StringBuffer = AllocateZeroPool (0x20); + StringBuffer = AllocateZeroPool(0x20); ASSERT (StringBuffer != NULL); UnicodeValueToStringS (StringBuffer, sizeof (CHAR16) * DestMax, LEFT_JUSTIFY, FreqMhz / 1000, 3); Index = StrnLenS (StringBuffer, DestMax); @@ -435,7 +435,7 @@ ConvertMemorySizeToString ( { CHAR16 *StringBuffer; - StringBuffer = AllocateZeroPool (0x24); + StringBuffer = AllocateZeroPool(0x24); ASSERT (StringBuffer != NULL); UnicodeValueToStringS (StringBuffer, 0x24, LEFT_JUSTIFY, MemorySize, 10); StrCatS (StringBuffer, 0x24 / sizeof (CHAR16), L" MB RAM"); @@ -467,7 +467,7 @@ GetOptionalStringByIndex ( UINTN StrSize; if (Index == 0) { - *String = AllocateZeroPool (sizeof (CHAR16)); + *String = AllocateZeroPool(sizeof (CHAR16)); return EFI_SUCCESS; } @@ -1091,9 +1091,9 @@ SetupResetReminder ( // if (IsResetRequired ()) { - StringBuffer1 = AllocateZeroPool (MAX_STRING_LEN * sizeof (CHAR16)); + StringBuffer1 = AllocateZeroPool(MAX_STRING_LEN * sizeof (CHAR16)); ASSERT (StringBuffer1 != NULL); - StringBuffer2 = AllocateZeroPool (MAX_STRING_LEN * sizeof (CHAR16)); + StringBuffer2 = AllocateZeroPool(MAX_STRING_LEN * sizeof (CHAR16)); ASSERT (StringBuffer2 != NULL); StrCpyS (StringBuffer1, MAX_STRING_LEN, L"Configuration changed. Reset to apply it Now."); StrCpyS (StringBuffer2, MAX_STRING_LEN, L"Press ENTER to reset"); diff --git a/MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c b/MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c index 7ee75e554..a2a03f8b8 100644 --- a/MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c +++ b/MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c @@ -303,7 +303,7 @@ UiCreateLanguageMenu ( // // Allocate extra 1 as the end tag. // - gLanguageToken = AllocateZeroPool ((OptionCount + 1) * sizeof (EFI_STRING_ID)); + gLanguageToken = AllocateZeroPool((OptionCount + 1) * sizeof (EFI_STRING_ID)); ASSERT (gLanguageToken != NULL); Status = gBS->LocateProtocol (&gEfiHiiStringProtocolGuid, NULL, (VOID **) &HiiString); @@ -317,7 +317,7 @@ UiCreateLanguageMenu ( StringSize = 0; Status = HiiString->GetString (HiiString, Lang, HiiHandle, PRINTABLE_LANGUAGE_NAME_STRING_ID, StringBuffer, &StringSize, NULL); if (Status == EFI_BUFFER_TOO_SMALL) { - StringBuffer = AllocateZeroPool (StringSize); + StringBuffer = AllocateZeroPool(StringSize); ASSERT (StringBuffer != NULL); Status = HiiString->GetString (HiiString, Lang, HiiHandle, PRINTABLE_LANGUAGE_NAME_STRING_ID, StringBuffer, &StringSize, NULL); ASSERT_EFI_ERROR(Status); @@ -587,7 +587,7 @@ UiListThirdPartyDrivers ( HiiHandles = HiiGetHiiHandles (NULL); ASSERT (HiiHandles != NULL); - gHiiDriverList = AllocateZeroPool (UI_HII_DRIVER_LIST_SIZE * sizeof (UI_HII_DRIVER_INSTANCE)); + gHiiDriverList = AllocateZeroPool(UI_HII_DRIVER_LIST_SIZE * sizeof (UI_HII_DRIVER_INSTANCE)); ASSERT (gHiiDriverList != NULL); DriverListPtr = gHiiDriverList; CurrentSize = UI_HII_DRIVER_LIST_SIZE; diff --git a/MdeModulePkg/Bus/Ata/AhciPei/AhciMode.c b/MdeModulePkg/Bus/Ata/AhciPei/AhciMode.c index 3579a5b9e..62cecfa44 100644 --- a/MdeModulePkg/Bus/Ata/AhciPei/AhciMode.c +++ b/MdeModulePkg/Bus/Ata/AhciPei/AhciMode.c @@ -1594,7 +1594,7 @@ CreateNewDevice ( PEI_AHCI_ATA_DEVICE_DATA *DeviceData; EFI_STATUS Status; - DeviceData = AllocateZeroPool (sizeof (PEI_AHCI_ATA_DEVICE_DATA)); + DeviceData = AllocateZeroPool(sizeof (PEI_AHCI_ATA_DEVICE_DATA)); if (DeviceData == NULL) { return EFI_OUT_OF_RESOURCES; } diff --git a/MdeModulePkg/Bus/Ata/AhciPei/AhciPei.c b/MdeModulePkg/Bus/Ata/AhciPei/AhciPei.c index 100b86233..009df4985 100644 --- a/MdeModulePkg/Bus/Ata/AhciPei/AhciPei.c +++ b/MdeModulePkg/Bus/Ata/AhciPei/AhciPei.c @@ -228,7 +228,7 @@ AtaAhciPeimEntry ( // // Memory allocation for controller private data. // - Private = AllocateZeroPool (sizeof (PEI_AHCI_CONTROLLER_PRIVATE_DATA)); + Private = AllocateZeroPool(sizeof (PEI_AHCI_CONTROLLER_PRIVATE_DATA)); if (Private == NULL) { DEBUG (( DEBUG_ERROR, "%a: Fail to allocate private data for Controller %d.\n", diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c index dc98624e8..0d3e01fc8 100644 --- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c +++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c @@ -1065,7 +1065,7 @@ CreateNewDeviceInfo ( { EFI_ATA_DEVICE_INFO *DeviceInfo; - DeviceInfo = AllocateZeroPool (sizeof (EFI_ATA_DEVICE_INFO)); + DeviceInfo = AllocateZeroPool(sizeof (EFI_ATA_DEVICE_INFO)); if (DeviceInfo == NULL) { return EFI_OUT_OF_RESOURCES; @@ -1361,7 +1361,7 @@ AtaPassThruPassThru ( // For non-blocking mode, queue the Task into the list. // if (Event != NULL) { - Task = AllocateZeroPool (sizeof (ATA_NONBLOCK_TASK)); + Task = AllocateZeroPool(sizeof (ATA_NONBLOCK_TASK)); if (Task == NULL) { return EFI_OUT_OF_RESOURCES; } diff --git a/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.c b/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.c index 12d0460b6..3d580f020 100644 --- a/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.c +++ b/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.c @@ -760,7 +760,7 @@ AtaBusDriverBindingStart ( // Check EFI_ALREADY_STARTED to reuse the original ATA_BUS_DRIVER_DATA. // if (Status != EFI_ALREADY_STARTED) { - AtaBusDriverData = AllocateZeroPool (sizeof (ATA_BUS_DRIVER_DATA)); + AtaBusDriverData = AllocateZeroPool(sizeof (ATA_BUS_DRIVER_DATA)); if (AtaBusDriverData == NULL) { Status = EFI_OUT_OF_RESOURCES; goto ErrorExit; diff --git a/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaPassThruExecute.c b/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaPassThruExecute.c index 233e4552b..392e9373f 100644 --- a/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaPassThruExecute.c +++ b/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaPassThruExecute.c @@ -808,7 +808,7 @@ AccessAtaDevice( OldTpl = gBS->RaiseTPL (TPL_NOTIFY); if (!IsListEmpty (&AtaDevice->AtaSubTaskList)) { - AtaTask = AllocateZeroPool (sizeof (ATA_BUS_ASYN_TASK)); + AtaTask = AllocateZeroPool(sizeof (ATA_BUS_ASYN_TASK)); if (AtaTask == NULL) { gBS->RestoreTPL (OldTpl); return EFI_OUT_OF_RESOURCES; @@ -828,12 +828,12 @@ AccessAtaDevice( gBS->RestoreTPL (OldTpl); Token->TransactionStatus = EFI_SUCCESS; - EventCount = AllocateZeroPool (sizeof (UINTN)); + EventCount = AllocateZeroPool(sizeof (UINTN)); if (EventCount == NULL) { return EFI_OUT_OF_RESOURCES; } - IsError = AllocateZeroPool (sizeof (BOOLEAN)); + IsError = AllocateZeroPool(sizeof (BOOLEAN)); if (IsError == NULL) { FreePool(EventCount); return EFI_OUT_OF_RESOURCES; @@ -870,7 +870,7 @@ AccessAtaDevice( SubTask = NULL; SubEvent = NULL; - SubTask = AllocateZeroPool (sizeof (ATA_BUS_ASYN_SUB_TASK)); + SubTask = AllocateZeroPool(sizeof (ATA_BUS_ASYN_SUB_TASK)); if (SubTask == NULL) { Status = EFI_OUT_OF_RESOURCES; goto EXIT; diff --git a/MdeModulePkg/Bus/I2c/I2cDxe/I2cBus.c b/MdeModulePkg/Bus/I2c/I2cDxe/I2cBus.c index 70fa3d14a..bdfd83387 100644 --- a/MdeModulePkg/Bus/I2c/I2cDxe/I2cBus.c +++ b/MdeModulePkg/Bus/I2c/I2cDxe/I2cBus.c @@ -635,7 +635,7 @@ I2cBusDriverStart ( // // Allocate the I2C context structure for the current I2C controller // - I2cBusContext = AllocateZeroPool (sizeof (I2C_BUS_CONTEXT)); + I2cBusContext = AllocateZeroPool(sizeof (I2C_BUS_CONTEXT)); if (I2cBusContext == NULL) { DEBUG ((EFI_D_ERROR, "I2cBus: there is no enough memory to allocate.\n")); Status = EFI_OUT_OF_RESOURCES; diff --git a/MdeModulePkg/Bus/I2c/I2cDxe/I2cHost.c b/MdeModulePkg/Bus/I2c/I2cDxe/I2cHost.c index d6a585bfd..f9413fca8 100644 --- a/MdeModulePkg/Bus/I2c/I2cDxe/I2cHost.c +++ b/MdeModulePkg/Bus/I2c/I2cDxe/I2cHost.c @@ -366,7 +366,7 @@ I2cHostDriverStart ( // // Allocate the I2C Host Context structure // - I2cHostContext = AllocateZeroPool (sizeof (I2C_HOST_CONTEXT)); + I2cHostContext = AllocateZeroPool(sizeof (I2C_HOST_CONTEXT)); if (I2cHostContext == NULL) { DEBUG ((EFI_D_ERROR, "I2cHost: there is no enough memory to allocate.\n")); Status = EFI_OUT_OF_RESOURCES; @@ -989,7 +989,7 @@ I2cHostQueueRequest ( // // Allocate the request structure // - I2cRequest = AllocateZeroPool (sizeof (I2C_REQUEST)); + I2cRequest = AllocateZeroPool(sizeof (I2C_REQUEST)); if (I2cRequest == NULL) { DEBUG ((EFI_D_ERROR, "WARNING - Failed to allocate I2C_REQUEST!\n")); return EFI_OUT_OF_RESOURCES; @@ -1008,7 +1008,7 @@ I2cHostQueueRequest ( // Copy request packet into private buffer, as RequestPacket may be freed during asynchronous transaction // RequestPacketSize = sizeof (UINTN) + RequestPacket->OperationCount * sizeof (EFI_I2C_OPERATION); - I2cRequest->RequestPacket = AllocateZeroPool (RequestPacketSize); + I2cRequest->RequestPacket = AllocateZeroPool(RequestPacketSize); ASSERT (I2cRequest->RequestPacket != NULL); CopyMem (I2cRequest->RequestPacket, RequestPacket, RequestPacketSize); diff --git a/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdTextIn.c b/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdTextIn.c index 540dd9b28..c95791708 100644 --- a/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdTextIn.c +++ b/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdTextIn.c @@ -593,7 +593,7 @@ KeyboardRegisterKeyNotify ( // // Allocate resource to save the notification function // - NewNotify = (KEYBOARD_CONSOLE_IN_EX_NOTIFY *) AllocateZeroPool (sizeof (KEYBOARD_CONSOLE_IN_EX_NOTIFY)); + NewNotify = (KEYBOARD_CONSOLE_IN_EX_NOTIFY *) AllocateZeroPool(sizeof (KEYBOARD_CONSOLE_IN_EX_NOTIFY)); if (NewNotify == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Exit; diff --git a/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.c b/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.c index 7fbf52528..38c2bd295 100644 --- a/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.c +++ b/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.c @@ -240,7 +240,7 @@ KbdControllerDriverStart ( // // Allocate private data // - ConsoleIn = AllocateZeroPool (sizeof (KEYBOARD_CONSOLE_IN_DEV)); + ConsoleIn = AllocateZeroPool(sizeof (KEYBOARD_CONSOLE_IN_DEV)); if (ConsoleIn == NULL) { Status = EFI_OUT_OF_RESOURCES; StatusCode = EFI_PERIPHERAL_KEYBOARD | EFI_P_EC_CONTROLLER_ERROR; diff --git a/MdeModulePkg/Bus/Isa/Ps2MouseDxe/Ps2Mouse.c b/MdeModulePkg/Bus/Isa/Ps2MouseDxe/Ps2Mouse.c index 05a7c1e2d..180d813f5 100644 --- a/MdeModulePkg/Bus/Isa/Ps2MouseDxe/Ps2Mouse.c +++ b/MdeModulePkg/Bus/Isa/Ps2MouseDxe/Ps2Mouse.c @@ -204,7 +204,7 @@ PS2MouseDriverStart ( // // Allocate private data // - MouseDev = AllocateZeroPool (sizeof (PS2_MOUSE_DEV)); + MouseDev = AllocateZeroPool(sizeof (PS2_MOUSE_DEV)); if (MouseDev == NULL) { Status = EFI_OUT_OF_RESOURCES; goto ErrorExit; diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c b/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c index 4bef7a693..f02127cf9 100644 --- a/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c +++ b/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c @@ -1525,7 +1525,7 @@ EhcCreateUsb2Hc ( USB2_HC_DEV *Ehc; EFI_STATUS Status; - Ehc = AllocateZeroPool (sizeof (USB2_HC_DEV)); + Ehc = AllocateZeroPool(sizeof (USB2_HC_DEV)); if (Ehc == NULL) { return NULL; diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c b/MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c index b8d1fa481..8d625036f 100644 --- a/MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c +++ b/MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c @@ -190,7 +190,7 @@ EhcInitSched ( // // Initialize the frame list entries then set the registers // - Ehc->PeriodFrameHost = AllocateZeroPool (EHC_FRAME_LEN * sizeof (UINTN)); + Ehc->PeriodFrameHost = AllocateZeroPool(EHC_FRAME_LEN * sizeof (UINTN)); if (Ehc->PeriodFrameHost == NULL) { Status = EFI_OUT_OF_RESOURCES; goto ErrorExit; diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/EhciUrb.c b/MdeModulePkg/Bus/Pci/EhciDxe/EhciUrb.c index 29c845b1a..c30aba917 100644 --- a/MdeModulePkg/Bus/Pci/EhciDxe/EhciUrb.c +++ b/MdeModulePkg/Bus/Pci/EhciDxe/EhciUrb.c @@ -559,7 +559,7 @@ EhcCreateUrb ( URB *Urb; VOID *Map; - Urb = AllocateZeroPool (sizeof (URB)); + Urb = AllocateZeroPool(sizeof (URB)); if (Urb == NULL) { return NULL; diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/UsbHcMem.c b/MdeModulePkg/Bus/Pci/EhciDxe/UsbHcMem.c index d6e160e88..3ac5e154b 100644 --- a/MdeModulePkg/Bus/Pci/EhciDxe/UsbHcMem.c +++ b/MdeModulePkg/Bus/Pci/EhciDxe/UsbHcMem.c @@ -36,7 +36,7 @@ UsbHcAllocMemBlock ( PciIo = Pool->PciIo; - Block = AllocateZeroPool (sizeof (USBHC_MEM_BLOCK)); + Block = AllocateZeroPool(sizeof (USBHC_MEM_BLOCK)); if (Block == NULL) { return NULL; } @@ -49,7 +49,7 @@ UsbHcAllocMemBlock ( Block->BufLen = EFI_PAGES_TO_SIZE (Pages); Block->BitsLen = Block->BufLen / (USBHC_MEM_UNIT * 8); - Block->Bits = AllocateZeroPool (Block->BitsLen); + Block->Bits = AllocateZeroPool(Block->BitsLen); if (Block->Bits == NULL) { gBS->FreePool(Block); diff --git a/MdeModulePkg/Bus/Pci/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c b/MdeModulePkg/Bus/Pci/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c index 1640eb0fa..39185c04e 100644 --- a/MdeModulePkg/Bus/Pci/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c +++ b/MdeModulePkg/Bus/Pci/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c @@ -323,7 +323,7 @@ PCheckDevice ( return EFI_UNSUPPORTED; } - AcpiPtr = AllocateZeroPool (sizeof (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR) * Index + sizeof (EFI_ACPI_END_TAG_DESCRIPTOR)); + AcpiPtr = AllocateZeroPool(sizeof (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR) * Index + sizeof (EFI_ACPI_END_TAG_DESCRIPTOR)); if (AcpiPtr == NULL) { return EFI_OUT_OF_RESOURCES; } diff --git a/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceDxe.c b/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceDxe.c index f7d04f361..9b41aef1c 100644 --- a/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceDxe.c +++ b/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceDxe.c @@ -143,7 +143,7 @@ NonDiscoverablePciDeviceStart ( return EFI_OUT_OF_RESOURCES; } - Dev = AllocateZeroPool (sizeof *Dev); + Dev = AllocateZeroPool(sizeof *Dev); if (Dev == NULL) { return EFI_OUT_OF_RESOURCES; } diff --git a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpress.c b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpress.c index bcfb16982..6ed7644ba 100644 --- a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpress.c +++ b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpress.c @@ -941,7 +941,7 @@ NvmExpressDriverBindingStart ( // Check EFI_ALREADY_STARTED to reuse the original NVME_CONTROLLER_PRIVATE_DATA. // if (Status != EFI_ALREADY_STARTED) { - Private = AllocateZeroPool (sizeof (NVME_CONTROLLER_PRIVATE_DATA)); + Private = AllocateZeroPool(sizeof (NVME_CONTROLLER_PRIVATE_DATA)); if (Private == NULL) { DEBUG ((EFI_D_ERROR, "NvmExpressDriverBindingStart: allocating pool for Nvme Private Data failed!\n")); diff --git a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressBlockIo.c b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressBlockIo.c index 92d15ab3c..d0a31c797 100644 --- a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressBlockIo.c +++ b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressBlockIo.c @@ -447,7 +447,7 @@ AsyncReadSectors ( Command = NULL; Completion = NULL; - Subtask = AllocateZeroPool (sizeof (NVME_BLKIO2_SUBTASK)); + Subtask = AllocateZeroPool(sizeof (NVME_BLKIO2_SUBTASK)); if (Subtask == NULL) { Status = EFI_OUT_OF_RESOURCES; goto ErrorExit; @@ -458,7 +458,7 @@ AsyncReadSectors ( Subtask->NamespaceId = Device->NamespaceId; Subtask->BlockIo2Request = Request; - CommandPacket = AllocateZeroPool (sizeof (EFI_NVM_EXPRESS_PASS_THRU_COMMAND_PACKET)); + CommandPacket = AllocateZeroPool(sizeof (EFI_NVM_EXPRESS_PASS_THRU_COMMAND_PACKET)); if (CommandPacket == NULL) { Status = EFI_OUT_OF_RESOURCES; goto ErrorExit; @@ -466,13 +466,13 @@ AsyncReadSectors ( Subtask->CommandPacket = CommandPacket; } - Command = AllocateZeroPool (sizeof (EFI_NVM_EXPRESS_COMMAND)); + Command = AllocateZeroPool(sizeof (EFI_NVM_EXPRESS_COMMAND)); if (Command == NULL) { Status = EFI_OUT_OF_RESOURCES; goto ErrorExit; } - Completion = AllocateZeroPool (sizeof (EFI_NVM_EXPRESS_COMPLETION)); + Completion = AllocateZeroPool(sizeof (EFI_NVM_EXPRESS_COMPLETION)); if (Completion == NULL) { Status = EFI_OUT_OF_RESOURCES; goto ErrorExit; @@ -586,7 +586,7 @@ AsyncWriteSectors ( Command = NULL; Completion = NULL; - Subtask = AllocateZeroPool (sizeof (NVME_BLKIO2_SUBTASK)); + Subtask = AllocateZeroPool(sizeof (NVME_BLKIO2_SUBTASK)); if (Subtask == NULL) { Status = EFI_OUT_OF_RESOURCES; goto ErrorExit; @@ -597,7 +597,7 @@ AsyncWriteSectors ( Subtask->NamespaceId = Device->NamespaceId; Subtask->BlockIo2Request = Request; - CommandPacket = AllocateZeroPool (sizeof (EFI_NVM_EXPRESS_PASS_THRU_COMMAND_PACKET)); + CommandPacket = AllocateZeroPool(sizeof (EFI_NVM_EXPRESS_PASS_THRU_COMMAND_PACKET)); if (CommandPacket == NULL) { Status = EFI_OUT_OF_RESOURCES; goto ErrorExit; @@ -605,13 +605,13 @@ AsyncWriteSectors ( Subtask->CommandPacket = CommandPacket; } - Command = AllocateZeroPool (sizeof (EFI_NVM_EXPRESS_COMMAND)); + Command = AllocateZeroPool(sizeof (EFI_NVM_EXPRESS_COMMAND)); if (Command == NULL) { Status = EFI_OUT_OF_RESOURCES; goto ErrorExit; } - Completion = AllocateZeroPool (sizeof (EFI_NVM_EXPRESS_COMPLETION)); + Completion = AllocateZeroPool(sizeof (EFI_NVM_EXPRESS_COMPLETION)); if (Completion == NULL) { Status = EFI_OUT_OF_RESOURCES; goto ErrorExit; @@ -721,7 +721,7 @@ NvmeAsyncRead ( Private = Device->Controller; BlockSize = Device->Media.BlockSize; OrginalBlocks = Blocks; - BlkIo2Req = AllocateZeroPool (sizeof (NVME_BLKIO2_REQUEST)); + BlkIo2Req = AllocateZeroPool(sizeof (NVME_BLKIO2_REQUEST)); if (BlkIo2Req == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -840,7 +840,7 @@ NvmeAsyncWrite ( Private = Device->Controller; BlockSize = Device->Media.BlockSize; OrginalBlocks = Blocks; - BlkIo2Req = AllocateZeroPool (sizeof (NVME_BLKIO2_REQUEST)); + BlkIo2Req = AllocateZeroPool(sizeof (NVME_BLKIO2_REQUEST)); if (BlkIo2Req == NULL) { return EFI_OUT_OF_RESOURCES; } diff --git a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c index eaaa28cb2..cd1ea5755 100644 --- a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c +++ b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c @@ -900,7 +900,7 @@ NvmeControllerInit ( // Allocate buffer for Identify Controller data // if (Private->ControllerData == NULL) { - Private->ControllerData = (NVME_ADMIN_CONTROLLER_DATA *)AllocateZeroPool (sizeof(NVME_ADMIN_CONTROLLER_DATA)); + Private->ControllerData = (NVME_ADMIN_CONTROLLER_DATA *)AllocateZeroPool(sizeof(NVME_ADMIN_CONTROLLER_DATA)); if (Private->ControllerData == NULL) { return EFI_OUT_OF_RESOURCES; diff --git a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c index 40310503e..a2360307b 100644 --- a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c +++ b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c @@ -724,7 +724,7 @@ NvmExpressPassThru ( // in the submission queue. // if ((Event != NULL) && (QueueId != 0)) { - AsyncRequest = AllocateZeroPool (sizeof (NVME_PASS_THRU_ASYNC_REQ)); + AsyncRequest = AllocateZeroPool(sizeof (NVME_PASS_THRU_ASYNC_REQ)); if (AsyncRequest == NULL) { Status = EFI_DEVICE_ERROR; goto EXIT; @@ -957,7 +957,7 @@ NvmExpressGetNextNamespace ( // // Allocate buffer for Identify Namespace data. // - NamespaceData = (NVME_ADMIN_NAMESPACE_DATA *)AllocateZeroPool (sizeof (NVME_ADMIN_NAMESPACE_DATA)); + NamespaceData = (NVME_ADMIN_NAMESPACE_DATA *)AllocateZeroPool(sizeof (NVME_ADMIN_NAMESPACE_DATA)); if (NamespaceData == NULL) { return EFI_NOT_FOUND; @@ -982,7 +982,7 @@ NvmExpressGetNextNamespace ( // // Allocate buffer for Identify Namespace data. // - NamespaceData = (NVME_ADMIN_NAMESPACE_DATA *)AllocateZeroPool (sizeof (NVME_ADMIN_NAMESPACE_DATA)); + NamespaceData = (NVME_ADMIN_NAMESPACE_DATA *)AllocateZeroPool(sizeof (NVME_ADMIN_NAMESPACE_DATA)); if (NamespaceData == NULL) { return EFI_NOT_FOUND; } @@ -1132,7 +1132,7 @@ NvmExpressBuildDevicePath ( return EFI_NOT_FOUND; } - Node = (NVME_NAMESPACE_DEVICE_PATH *)AllocateZeroPool (sizeof (NVME_NAMESPACE_DEVICE_PATH)); + Node = (NVME_NAMESPACE_DEVICE_PATH *)AllocateZeroPool(sizeof (NVME_NAMESPACE_DEVICE_PATH)); if (Node == NULL) { return EFI_OUT_OF_RESOURCES; } diff --git a/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPei.c b/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPei.c index 19504ba72..59e01454d 100644 --- a/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPei.c +++ b/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPei.c @@ -65,7 +65,7 @@ EnumerateNvmeDevNamespace ( UINT32 Flbas; UINT32 LbaFmtIdx; - NamespaceData = (NVME_ADMIN_NAMESPACE_DATA *) AllocateZeroPool (sizeof (NVME_ADMIN_NAMESPACE_DATA)); + NamespaceData = (NVME_ADMIN_NAMESPACE_DATA *) AllocateZeroPool(sizeof (NVME_ADMIN_NAMESPACE_DATA)); if (NamespaceData == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -146,7 +146,7 @@ NvmeDiscoverNamespaces ( UINT32 NamespaceId; Private->ActiveNamespaceNum = 0; - Private->NamespaceInfo = AllocateZeroPool (Private->ControllerData->Nn * sizeof (PEI_NVME_NAMESPACE_INFO)); + Private->NamespaceInfo = AllocateZeroPool(Private->ControllerData->Nn * sizeof (PEI_NVME_NAMESPACE_INFO)); // // According to Nvm Express 1.1 spec Figure 82, the field 'Nn' of the identify @@ -307,7 +307,7 @@ NvmExpressPeimEntry ( // // Memory allocation for controller private data // - Private = AllocateZeroPool (sizeof (PEI_NVME_CONTROLLER_PRIVATE_DATA)); + Private = AllocateZeroPool(sizeof (PEI_NVME_CONTROLLER_PRIVATE_DATA)); if (Private == NULL) { DEBUG (( DEBUG_ERROR, "%a: Fail to allocate private data for Controller %d.\n", diff --git a/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiHci.c b/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiHci.c index 40e641870..175483ead 100644 --- a/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiHci.c +++ b/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiHci.c @@ -652,7 +652,7 @@ NvmeControllerInit ( // Get the Identify Controller data // if (Private->ControllerData == NULL) { - Private->ControllerData = (NVME_ADMIN_CONTROLLER_DATA *)AllocateZeroPool (sizeof (NVME_ADMIN_CONTROLLER_DATA)); + Private->ControllerData = (NVME_ADMIN_CONTROLLER_DATA *)AllocateZeroPool(sizeof (NVME_ADMIN_CONTROLLER_DATA)); if (Private->ControllerData == NULL) { return EFI_OUT_OF_RESOURCES; } diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c index e6d751929..f95a5203d 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c @@ -834,7 +834,7 @@ CreateRootBridge ( EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath; EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRootBridgeIo; - Dev = AllocateZeroPool (sizeof (PCI_IO_DEVICE)); + Dev = AllocateZeroPool(sizeof (PCI_IO_DEVICE)); if (Dev == NULL) { return NULL; } diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDriverOverride.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciDriverOverride.c index 7f30f3a4f..372a19a3c 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDriverOverride.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciDriverOverride.c @@ -171,7 +171,7 @@ AddDriver ( // ASSERT ((DriverImageHandle == NULL) || (DriverImagePath == NULL)); - Node = AllocateZeroPool (sizeof (PCI_DRIVER_OVERRIDE_LIST)); + Node = AllocateZeroPool(sizeof (PCI_DRIVER_OVERRIDE_LIST)); if (Node == NULL) { return EFI_OUT_OF_RESOURCES; } diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.c index 81a789e88..81c5d41e4 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.c @@ -1128,7 +1128,7 @@ ConstructAcpiResourceRequestor ( // If there is at least one type of resource request, // allocate a acpi resource node // - Configuration = AllocateZeroPool (sizeof (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR) * NumConfig + sizeof (EFI_ACPI_END_TAG_DESCRIPTOR)); + Configuration = AllocateZeroPool(sizeof (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR) * NumConfig + sizeof (EFI_ACPI_END_TAG_DESCRIPTOR)); if (Configuration == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -1261,7 +1261,7 @@ ConstructAcpiResourceRequestor ( // // If there is no resource request // - Configuration = AllocateZeroPool (sizeof (EFI_ACPI_END_TAG_DESCRIPTOR)); + Configuration = AllocateZeroPool(sizeof (EFI_ACPI_END_TAG_DESCRIPTOR)); if (Configuration == NULL) { return EFI_OUT_OF_RESOURCES; } diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c index 4f61d1e78..93eb4960b 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c @@ -2096,7 +2096,7 @@ CreatePciIoDevice ( EFI_PCI_IO_PROTOCOL *PciIo; EFI_STATUS Status; - PciIoDevice = AllocateZeroPool (sizeof (PCI_IO_DEVICE)); + PciIoDevice = AllocateZeroPool(sizeof (PCI_IO_DEVICE)); if (PciIoDevice == NULL) { return NULL; } diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciHotPlugSupport.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciHotPlugSupport.c index e7b8043df..92bb3bc5b 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciHotPlugSupport.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciHotPlugSupport.c @@ -117,7 +117,7 @@ InitializeHotPlugSupport ( gPciRootHpcPool = HpcList; gPciRootHpcCount = HpcCount; - gPciRootHpcData = AllocateZeroPool (sizeof (ROOT_HPC_DATA) * gPciRootHpcCount); + gPciRootHpcData = AllocateZeroPool(sizeof (ROOT_HPC_DATA) * gPciRootHpcCount); if (gPciRootHpcData == NULL) { return EFI_OUT_OF_RESOURCES; } diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c index 0bd6119f1..9d03bd6f6 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c @@ -1881,7 +1881,7 @@ PciIoGetBarAttributes ( } if (Resources != NULL) { - Descriptor = AllocateZeroPool (sizeof (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR) + sizeof (EFI_ACPI_END_TAG_DESCRIPTOR)); + Descriptor = AllocateZeroPool(sizeof (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR) + sizeof (EFI_ACPI_END_TAG_DESCRIPTOR)); if (Descriptor == NULL) { return EFI_OUT_OF_RESOURCES; } diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciResourceSupport.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciResourceSupport.c index 4e16ac19c..f7e9348dd 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciResourceSupport.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciResourceSupport.c @@ -667,7 +667,7 @@ CreateResourceNode ( Node = NULL; - Node = AllocateZeroPool (sizeof (PCI_RESOURCE_NODE)); + Node = AllocateZeroPool(sizeof (PCI_RESOURCE_NODE)); ASSERT (Node != NULL); if (Node == NULL) { return NULL; diff --git a/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridge.c b/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridge.c index dcafc3e94..206f4c5fc 100644 --- a/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridge.c +++ b/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridge.c @@ -404,7 +404,7 @@ InitializePciHostBridge ( // // Most systems in the world including complex servers have only one Host Bridge. // - HostBridge = AllocateZeroPool (sizeof (PCI_HOST_BRIDGE_INSTANCE)); + HostBridge = AllocateZeroPool(sizeof (PCI_HOST_BRIDGE_INSTANCE)); ASSERT (HostBridge != NULL); HostBridge->Signature = PCI_HOST_BRIDGE_SIGNATURE; @@ -1489,7 +1489,7 @@ GetProposedResources ( } } - Buffer = AllocateZeroPool (Number * sizeof (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR) + sizeof (EFI_ACPI_END_TAG_DESCRIPTOR)); + Buffer = AllocateZeroPool(Number * sizeof (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR) + sizeof (EFI_ACPI_END_TAG_DESCRIPTOR)); if (Buffer == NULL) { return EFI_OUT_OF_RESOURCES; } diff --git a/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciRootBridgeIo.c b/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciRootBridgeIo.c index 40daea558..3714184f6 100644 --- a/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciRootBridgeIo.c +++ b/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciRootBridgeIo.c @@ -171,7 +171,7 @@ CreateRootBridge ( } } - RootBridge = AllocateZeroPool (sizeof (PCI_ROOT_BRIDGE_INSTANCE)); + RootBridge = AllocateZeroPool(sizeof (PCI_ROOT_BRIDGE_INSTANCE)); ASSERT (RootBridge != NULL); RootBridge->Signature = PCI_ROOT_BRIDGE_SIGNATURE; diff --git a/MdeModulePkg/Bus/Pci/SataControllerDxe/SataController.c b/MdeModulePkg/Bus/Pci/SataControllerDxe/SataController.c index 6ef536c91..e42193f83 100644 --- a/MdeModulePkg/Bus/Pci/SataControllerDxe/SataController.c +++ b/MdeModulePkg/Bus/Pci/SataControllerDxe/SataController.c @@ -385,7 +385,7 @@ SataControllerStart ( // // Allocate Sata Private Data structure // - Private = AllocateZeroPool (sizeof (EFI_SATA_CONTROLLER_PRIVATE_DATA)); + Private = AllocateZeroPool(sizeof (EFI_SATA_CONTROLLER_PRIVATE_DATA)); if (Private == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Done; @@ -499,19 +499,19 @@ SataControllerStart ( } TotalCount = (UINTN) (Private->IdeInit.ChannelCount) * (UINTN) (Private->DeviceCount); - Private->DisqualifiedModes = AllocateZeroPool ((sizeof (EFI_ATA_COLLECTIVE_MODE)) * TotalCount); + Private->DisqualifiedModes = AllocateZeroPool((sizeof (EFI_ATA_COLLECTIVE_MODE)) * TotalCount); if (Private->DisqualifiedModes == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Done; } - Private->IdentifyData = AllocateZeroPool ((sizeof (EFI_IDENTIFY_DATA)) * TotalCount); + Private->IdentifyData = AllocateZeroPool((sizeof (EFI_IDENTIFY_DATA)) * TotalCount); if (Private->IdentifyData == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Done; } - Private->IdentifyValid = AllocateZeroPool ((sizeof (BOOLEAN)) * TotalCount); + Private->IdentifyValid = AllocateZeroPool((sizeof (BOOLEAN)) * TotalCount); if (Private->IdentifyValid == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Done; @@ -1016,7 +1016,7 @@ IdeInitCalculateMode ( return EFI_INVALID_PARAMETER; } - *SupportedModes = AllocateZeroPool (sizeof (EFI_ATA_COLLECTIVE_MODE)); + *SupportedModes = AllocateZeroPool(sizeof (EFI_ATA_COLLECTIVE_MODE)); if (*SupportedModes == NULL) { ASSERT (*SupportedModes != NULL); return EFI_OUT_OF_RESOURCES; diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c index 114e1086b..b4a7fb713 100644 --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c @@ -1659,7 +1659,7 @@ SdMmcCreateTrb ( EFI_PCI_IO_PROTOCOL *PciIo; UINTN MapLength; - Trb = AllocateZeroPool (sizeof (SD_MMC_HC_TRB)); + Trb = AllocateZeroPool(sizeof (SD_MMC_HC_TRB)); if (Trb == NULL) { return NULL; } diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcPei/SdMmcPciHcPei.c b/MdeModulePkg/Bus/Pci/SdMmcPciHcPei/SdMmcPciHcPei.c index 8ca8855c7..bc70bd68a 100644 --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcPei/SdMmcPciHcPei.c +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcPei/SdMmcPciHcPei.c @@ -106,7 +106,7 @@ InitializeSdMmcHcPeim ( return EFI_SUCCESS; } - Private = (SD_MMC_HC_PEI_PRIVATE_DATA *) AllocateZeroPool (sizeof (SD_MMC_HC_PEI_PRIVATE_DATA)); + Private = (SD_MMC_HC_PEI_PRIVATE_DATA *) AllocateZeroPool(sizeof (SD_MMC_HC_PEI_PRIVATE_DATA)); if (Private == NULL) { DEBUG ((EFI_D_ERROR, "Failed to allocate memory for SD_MMC_HC_PEI_PRIVATE_DATA! \n")); return EFI_OUT_OF_RESOURCES; diff --git a/MdeModulePkg/Bus/Pci/UfsPciHcPei/UfsPciHcPei.c b/MdeModulePkg/Bus/Pci/UfsPciHcPei/UfsPciHcPei.c index 4c4a4094a..ef3e78b65 100644 --- a/MdeModulePkg/Bus/Pci/UfsPciHcPei/UfsPciHcPei.c +++ b/MdeModulePkg/Bus/Pci/UfsPciHcPei/UfsPciHcPei.c @@ -95,7 +95,7 @@ InitializeUfsHcPeim ( return EFI_SUCCESS; } - Private = (UFS_HC_PEI_PRIVATE_DATA *) AllocateZeroPool (sizeof (UFS_HC_PEI_PRIVATE_DATA)); + Private = (UFS_HC_PEI_PRIVATE_DATA *) AllocateZeroPool(sizeof (UFS_HC_PEI_PRIVATE_DATA)); if (Private == NULL) { DEBUG ((EFI_D_ERROR, "Failed to allocate memory for UFS_HC_PEI_PRIVATE_DATA! \n")); return EFI_OUT_OF_RESOURCES; diff --git a/MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c b/MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c index 14b515dd7..c68ef91f6 100644 --- a/MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c +++ b/MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c @@ -1435,7 +1435,7 @@ UhciAllocateDev ( USB_HC_DEV *Uhc; EFI_STATUS Status; - Uhc = AllocateZeroPool (sizeof (USB_HC_DEV)); + Uhc = AllocateZeroPool(sizeof (USB_HC_DEV)); if (Uhc == NULL) { return NULL; diff --git a/MdeModulePkg/Bus/Pci/UhciDxe/UhciSched.c b/MdeModulePkg/Bus/Pci/UhciDxe/UhciSched.c index 13cf18665..da4b33209 100644 --- a/MdeModulePkg/Bus/Pci/UhciDxe/UhciSched.c +++ b/MdeModulePkg/Bus/Pci/UhciDxe/UhciSched.c @@ -119,7 +119,7 @@ UhciInitFrameList ( Uhc->BulkQh->NextQh = NULL; - Uhc->FrameBaseHostAddr = AllocateZeroPool (4096); + Uhc->FrameBaseHostAddr = AllocateZeroPool(4096); if (Uhc->FrameBaseHostAddr == NULL) { Status = EFI_OUT_OF_RESOURCES; goto ON_ERROR; diff --git a/MdeModulePkg/Bus/Pci/UhciDxe/UsbHcMem.c b/MdeModulePkg/Bus/Pci/UhciDxe/UsbHcMem.c index f5e219631..0bb6ecff1 100644 --- a/MdeModulePkg/Bus/Pci/UhciDxe/UsbHcMem.c +++ b/MdeModulePkg/Bus/Pci/UhciDxe/UsbHcMem.c @@ -41,7 +41,7 @@ UsbHcAllocMemBlock ( PciIo = Pool->PciIo; - Block = AllocateZeroPool (sizeof (USBHC_MEM_BLOCK)); + Block = AllocateZeroPool(sizeof (USBHC_MEM_BLOCK)); if (Block == NULL) { return NULL; } @@ -54,7 +54,7 @@ UsbHcAllocMemBlock ( Block->BufLen = EFI_PAGES_TO_SIZE (Pages); Block->BitsLen = Block->BufLen / (USBHC_MEM_UNIT * 8); - Block->Bits = AllocateZeroPool (Block->BitsLen); + Block->Bits = AllocateZeroPool(Block->BitsLen); if (Block->Bits == NULL) { gBS->FreePool(Block); diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/UsbHcMem.c b/MdeModulePkg/Bus/Pci/XhciDxe/UsbHcMem.c index 44ebe4bd1..d347ba022 100644 --- a/MdeModulePkg/Bus/Pci/XhciDxe/UsbHcMem.c +++ b/MdeModulePkg/Bus/Pci/XhciDxe/UsbHcMem.c @@ -36,7 +36,7 @@ UsbHcAllocMemBlock ( PciIo = Pool->PciIo; - Block = AllocateZeroPool (sizeof (USBHC_MEM_BLOCK)); + Block = AllocateZeroPool(sizeof (USBHC_MEM_BLOCK)); if (Block == NULL) { return NULL; } @@ -49,7 +49,7 @@ UsbHcAllocMemBlock ( Block->BufLen = EFI_PAGES_TO_SIZE (Pages); Block->BitsLen = Block->BufLen / (USBHC_MEM_UNIT * 8); - Block->Bits = AllocateZeroPool (Block->BitsLen); + Block->Bits = AllocateZeroPool(Block->BitsLen); if (Block->Bits == NULL) { gBS->FreePool(Block); diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c index 7245c54b3..56b896faf 100644 --- a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c +++ b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c @@ -1008,7 +1008,7 @@ XhcControlTransfer ( } else { MaxPacket0 = Xhc->UsbDevContext[SlotId].DevDesc.MaxPacketSize0; } - Xhc->UsbDevContext[SlotId].ConfDesc = AllocateZeroPool (Xhc->UsbDevContext[SlotId].DevDesc.NumConfigurations * sizeof (EFI_USB_CONFIG_DESCRIPTOR *)); + Xhc->UsbDevContext[SlotId].ConfDesc = AllocateZeroPool(Xhc->UsbDevContext[SlotId].DevDesc.NumConfigurations * sizeof (EFI_USB_CONFIG_DESCRIPTOR *)); if (Xhc->HcCParams.Data.Csz == 0) { Status = XhcEvaluateContext (Xhc, SlotId, MaxPacket0); } else { @@ -1027,7 +1027,7 @@ XhcControlTransfer ( // // Default to use AlternateSetting 0 for all interfaces. // - Xhc->UsbDevContext[SlotId].ActiveAlternateSetting = AllocateZeroPool (Xhc->UsbDevContext[SlotId].ConfDesc[Index]->NumInterfaces * sizeof (UINT8)); + Xhc->UsbDevContext[SlotId].ActiveAlternateSetting = AllocateZeroPool(Xhc->UsbDevContext[SlotId].ConfDesc[Index]->NumInterfaces * sizeof (UINT8)); } } else if (((DescriptorType == USB_DESC_TYPE_HUB) || (DescriptorType == USB_DESC_TYPE_HUB_SUPER_SPEED)) && (*DataLength > 2)) { @@ -1752,7 +1752,7 @@ XhcCreateUsbHc ( UINT16 ExtCapReg; UINT8 ReleaseNumber; - Xhc = AllocateZeroPool (sizeof (USB_XHCI_INSTANCE)); + Xhc = AllocateZeroPool(sizeof (USB_XHCI_INSTANCE)); if (Xhc == NULL) { return NULL; diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c index 45b0187c3..1bc5ef1cb 100644 --- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c +++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c @@ -26,7 +26,7 @@ XhcCreateCmdTrb ( { URB *Urb; - Urb = AllocateZeroPool (sizeof (URB)); + Urb = AllocateZeroPool(sizeof (URB)); if (Urb == NULL) { return NULL; } @@ -146,7 +146,7 @@ XhcCreateUrb ( EFI_STATUS Status; URB *Urb; - Urb = AllocateZeroPool (sizeof (URB)); + Urb = AllocateZeroPool(sizeof (URB)); if (Urb == NULL) { return NULL; } @@ -511,14 +511,14 @@ XhcInitSched ( // // Allocate the buffer to record the Mapping for each scratch buffer in order to Unmap them // - ScratchEntryMap = AllocateZeroPool (sizeof (UINTN) * MaxScratchpadBufs); + ScratchEntryMap = AllocateZeroPool(sizeof (UINTN) * MaxScratchpadBufs); ASSERT (ScratchEntryMap != NULL); Xhc->ScratchEntryMap = ScratchEntryMap; // // Allocate the buffer to record the host address for each entry // - ScratchEntry = AllocateZeroPool (sizeof (UINT64) * MaxScratchpadBufs); + ScratchEntry = AllocateZeroPool(sizeof (UINT64) * MaxScratchpadBufs); ASSERT (ScratchEntry != NULL); Xhc->ScratchEntry = ScratchEntry; @@ -1435,7 +1435,7 @@ XhciInsertAsyncIntTransfer ( VOID *Data; URB *Urb; - Data = AllocateZeroPool (DataLen); + Data = AllocateZeroPool(DataLen); if (Data == NULL) { DEBUG ((DEBUG_ERROR, "%a: failed to allocate buffer\n", __FUNCTION__)); return NULL; @@ -1619,7 +1619,7 @@ XhcMonitorAsyncRequests ( // Make sure the data received from HW is no more than expected. // if (Urb->Completed <= Urb->DataLen) { - ProcBuf = AllocateZeroPool (Urb->Completed); + ProcBuf = AllocateZeroPool(Urb->Completed); } if (ProcBuf == NULL) { @@ -2164,7 +2164,7 @@ XhcInitializeDeviceSlot ( // // 4) Allocate and initialize the Transfer Ring for the Default Control Endpoint. // - EndpointTransferRing = AllocateZeroPool (sizeof (TRANSFER_RING)); + EndpointTransferRing = AllocateZeroPool(sizeof (TRANSFER_RING)); Xhc->UsbDevContext[SlotId].EndpointTransferRing[0] = EndpointTransferRing; CreateTransferRing(Xhc, TR_RING_TRB_NUMBER, (TRANSFER_RING *)Xhc->UsbDevContext[SlotId].EndpointTransferRing[0]); // @@ -2374,7 +2374,7 @@ XhcInitializeDeviceSlot64 ( // // 4) Allocate and initialize the Transfer Ring for the Default Control Endpoint. // - EndpointTransferRing = AllocateZeroPool (sizeof (TRANSFER_RING)); + EndpointTransferRing = AllocateZeroPool(sizeof (TRANSFER_RING)); Xhc->UsbDevContext[SlotId].EndpointTransferRing[0] = EndpointTransferRing; CreateTransferRing(Xhc, TR_RING_TRB_NUMBER, (TRANSFER_RING *)Xhc->UsbDevContext[SlotId].EndpointTransferRing[0]); // diff --git a/MdeModulePkg/Bus/Pci/XhciPei/XhcPeim.c b/MdeModulePkg/Bus/Pci/XhciPei/XhcPeim.c index bb5925545..40d5b738f 100644 --- a/MdeModulePkg/Bus/Pci/XhciPei/XhcPeim.c +++ b/MdeModulePkg/Bus/Pci/XhciPei/XhcPeim.c @@ -679,7 +679,7 @@ XhcPeiControlTransfer ( } else { MaxPacket0 = Xhc->UsbDevContext[SlotId].DevDesc.MaxPacketSize0; } - Xhc->UsbDevContext[SlotId].ConfDesc = AllocateZeroPool (Xhc->UsbDevContext[SlotId].DevDesc.NumConfigurations * sizeof (EFI_USB_CONFIG_DESCRIPTOR *)); + Xhc->UsbDevContext[SlotId].ConfDesc = AllocateZeroPool(Xhc->UsbDevContext[SlotId].DevDesc.NumConfigurations * sizeof (EFI_USB_CONFIG_DESCRIPTOR *)); if (Xhc->UsbDevContext[SlotId].ConfDesc == NULL) { Status = EFI_OUT_OF_RESOURCES; goto ON_EXIT; @@ -697,7 +697,7 @@ XhcPeiControlTransfer ( // Index = (UINT8) Request->Value; ASSERT (Index < Xhc->UsbDevContext[SlotId].DevDesc.NumConfigurations); - Xhc->UsbDevContext[SlotId].ConfDesc[Index] = AllocateZeroPool (*DataLength); + Xhc->UsbDevContext[SlotId].ConfDesc[Index] = AllocateZeroPool(*DataLength); if (Xhc->UsbDevContext[SlotId].ConfDesc[Index] == NULL) { Status = EFI_OUT_OF_RESOURCES; goto ON_EXIT; diff --git a/MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c b/MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c index d0fa24ba8..d0210533c 100644 --- a/MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c +++ b/MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c @@ -27,7 +27,7 @@ XhcPeiCreateCmdTrb ( { URB *Urb; - Urb = AllocateZeroPool (sizeof (URB)); + Urb = AllocateZeroPool(sizeof (URB)); if (Urb == NULL) { return NULL; } @@ -145,7 +145,7 @@ XhcPeiCreateUrb ( EFI_STATUS Status; URB *Urb; - Urb = AllocateZeroPool (sizeof (URB)); + Urb = AllocateZeroPool(sizeof (URB)); if (Urb == NULL) { return NULL; } @@ -1154,7 +1154,7 @@ XhcPeiInitializeDeviceSlot ( // // 4) Allocate and initialize the Transfer Ring for the Default Control Endpoint. // - EndpointTransferRing = AllocateZeroPool (sizeof (TRANSFER_RING)); + EndpointTransferRing = AllocateZeroPool(sizeof (TRANSFER_RING)); Xhc->UsbDevContext[SlotId].EndpointTransferRing[0] = EndpointTransferRing; XhcPeiCreateTransferRing (Xhc, TR_RING_TRB_NUMBER, (TRANSFER_RING *) Xhc->UsbDevContext[SlotId].EndpointTransferRing[0]); // @@ -1365,7 +1365,7 @@ XhcPeiInitializeDeviceSlot64 ( // // 4) Allocate and initialize the Transfer Ring for the Default Control Endpoint. // - EndpointTransferRing = AllocateZeroPool (sizeof (TRANSFER_RING)); + EndpointTransferRing = AllocateZeroPool(sizeof (TRANSFER_RING)); Xhc->UsbDevContext[SlotId].EndpointTransferRing[0] = EndpointTransferRing; XhcPeiCreateTransferRing(Xhc, TR_RING_TRB_NUMBER, (TRANSFER_RING *) Xhc->UsbDevContext[SlotId].EndpointTransferRing[0]); // @@ -1754,7 +1754,7 @@ XhcPeiSetConfigCmd ( InputContext->EP[Dci-1].AverageTRBLength = 0x1000; if (Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci-1] == NULL) { - EndpointTransferRing = AllocateZeroPool (sizeof (TRANSFER_RING)); + EndpointTransferRing = AllocateZeroPool(sizeof (TRANSFER_RING)); Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci-1] = (VOID *) EndpointTransferRing; XhcPeiCreateTransferRing (Xhc, TR_RING_TRB_NUMBER, (TRANSFER_RING *) Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci-1]); } @@ -1818,7 +1818,7 @@ XhcPeiSetConfigCmd ( } if (Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci-1] == NULL) { - EndpointTransferRing = AllocateZeroPool (sizeof (TRANSFER_RING)); + EndpointTransferRing = AllocateZeroPool(sizeof (TRANSFER_RING)); Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci-1] = (VOID *) EndpointTransferRing; XhcPeiCreateTransferRing (Xhc, TR_RING_TRB_NUMBER, (TRANSFER_RING *) Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci-1]); } @@ -1971,7 +1971,7 @@ XhcPeiSetConfigCmd64 ( InputContext->EP[Dci-1].AverageTRBLength = 0x1000; if (Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci-1] == NULL) { - EndpointTransferRing = AllocateZeroPool (sizeof (TRANSFER_RING)); + EndpointTransferRing = AllocateZeroPool(sizeof (TRANSFER_RING)); Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci-1] = (VOID *) EndpointTransferRing; XhcPeiCreateTransferRing (Xhc, TR_RING_TRB_NUMBER, (TRANSFER_RING *) Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci-1]); } @@ -2035,7 +2035,7 @@ XhcPeiSetConfigCmd64 ( } if (Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci-1] == NULL) { - EndpointTransferRing = AllocateZeroPool (sizeof (TRANSFER_RING)); + EndpointTransferRing = AllocateZeroPool(sizeof (TRANSFER_RING)); Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci-1] = (VOID *) EndpointTransferRing; XhcPeiCreateTransferRing (Xhc, TR_RING_TRB_NUMBER, (TRANSFER_RING *) Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci-1]); } @@ -2870,14 +2870,14 @@ XhcPeiInitSched ( // // Allocate the buffer to record the Mapping for each scratch buffer in order to Unmap them // - ScratchEntryMap = AllocateZeroPool (sizeof (UINTN) * MaxScratchpadBufs); + ScratchEntryMap = AllocateZeroPool(sizeof (UINTN) * MaxScratchpadBufs); ASSERT (ScratchEntryMap != NULL); Xhc->ScratchEntryMap = ScratchEntryMap; // // Allocate the buffer to record the host address for each entry // - ScratchEntry = AllocateZeroPool (sizeof (UINT64) * MaxScratchpadBufs); + ScratchEntry = AllocateZeroPool(sizeof (UINT64) * MaxScratchpadBufs); ASSERT (ScratchEntry != NULL); Xhc->ScratchEntry = ScratchEntry; diff --git a/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c b/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c index 77133c658..a25d50083 100644 --- a/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c +++ b/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c @@ -1174,7 +1174,7 @@ ScsiScanCreateDevice ( goto ErrorExit; } - ScsiIoDevice = AllocateZeroPool (sizeof (SCSI_IO_DEV)); + ScsiIoDevice = AllocateZeroPool(sizeof (SCSI_IO_DEV)); if (ScsiIoDevice == NULL) { Status = EFI_OUT_OF_RESOURCES; goto ErrorExit; diff --git a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c index 047454f93..d6197dd66 100644 --- a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c +++ b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c @@ -206,7 +206,7 @@ ScsiDiskDriverBindingStart ( MustReadCapacity = TRUE; - ScsiDiskDevice = (SCSI_DISK_DEV *) AllocateZeroPool (sizeof (SCSI_DISK_DEV)); + ScsiDiskDevice = (SCSI_DISK_DEV *) AllocateZeroPool(sizeof (SCSI_DISK_DEV)); if (ScsiDiskDevice == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -263,7 +263,7 @@ ScsiDiskDriverBindingStart ( // The Sense Data Array's initial size is 6 // ScsiDiskDevice->SenseDataNumber = 6; - ScsiDiskDevice->SenseData = (EFI_SCSI_SENSE_DATA *) AllocateZeroPool ( + ScsiDiskDevice->SenseData = (EFI_SCSI_SENSE_DATA *) AllocateZeroPool( sizeof (EFI_SCSI_SENSE_DATA) * ScsiDiskDevice->SenseDataNumber ); if (ScsiDiskDevice->SenseData == NULL) { @@ -1420,13 +1420,13 @@ ScsiDiskUnmap ( goto Done; } - EraseBlkReq = AllocateZeroPool (sizeof (SCSI_ERASEBLK_REQUEST)); + EraseBlkReq = AllocateZeroPool(sizeof (SCSI_ERASEBLK_REQUEST)); if (EraseBlkReq == NULL) { ReturnStatus = EFI_DEVICE_ERROR; goto Done; } - EraseBlkReq->CommandPacket.Cdb = AllocateZeroPool (0xA); + EraseBlkReq->CommandPacket.Cdb = AllocateZeroPool(0xA); if (EraseBlkReq->CommandPacket.Cdb == NULL) { ReturnStatus = EFI_DEVICE_ERROR; goto Done; @@ -1435,7 +1435,7 @@ ScsiDiskUnmap ( BlkDespCnt = (UINT32) ((Blocks - 1) / MaxLbaCnt + 1); UnmapParamListLen = (UINT16) (sizeof (EFI_SCSI_DISK_UNMAP_PARAM_LIST_HEADER) + BlkDespCnt * sizeof (EFI_SCSI_DISK_UNMAP_BLOCK_DESP)); - UnmapParamList = AllocateZeroPool (UnmapParamListLen); + UnmapParamList = AllocateZeroPool(UnmapParamListLen); if (UnmapParamList == NULL) { ReturnStatus = EFI_DEVICE_ERROR; goto Done; @@ -3194,7 +3194,7 @@ ScsiDiskAsyncReadSectors ( return EFI_INVALID_PARAMETER; } - BlkIo2Req = AllocateZeroPool (sizeof (SCSI_BLKIO2_REQUEST)); + BlkIo2Req = AllocateZeroPool(sizeof (SCSI_BLKIO2_REQUEST)); if (BlkIo2Req == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -3411,7 +3411,7 @@ ScsiDiskAsyncWriteSectors ( return EFI_INVALID_PARAMETER; } - BlkIo2Req = AllocateZeroPool (sizeof (SCSI_BLKIO2_REQUEST)); + BlkIo2Req = AllocateZeroPool(sizeof (SCSI_BLKIO2_REQUEST)); if (BlkIo2Req == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -4405,7 +4405,7 @@ ScsiDiskAsyncRead10 ( AsyncIoEvent = NULL; - Request = AllocateZeroPool (sizeof (SCSI_ASYNC_RW_REQUEST)); + Request = AllocateZeroPool(sizeof (SCSI_ASYNC_RW_REQUEST)); if (Request == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -4415,7 +4415,7 @@ ScsiDiskAsyncRead10 ( gBS->RestoreTPL (OldTpl); Request->SenseDataLength = (UINT8) (6 * sizeof (EFI_SCSI_SENSE_DATA)); - Request->SenseData = AllocateZeroPool (Request->SenseDataLength); + Request->SenseData = AllocateZeroPool(Request->SenseDataLength); if (Request->SenseData == NULL) { Status = EFI_OUT_OF_RESOURCES; goto ErrorExit; @@ -4524,7 +4524,7 @@ ScsiDiskAsyncWrite10 ( AsyncIoEvent = NULL; - Request = AllocateZeroPool (sizeof (SCSI_ASYNC_RW_REQUEST)); + Request = AllocateZeroPool(sizeof (SCSI_ASYNC_RW_REQUEST)); if (Request == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -4534,7 +4534,7 @@ ScsiDiskAsyncWrite10 ( gBS->RestoreTPL (OldTpl); Request->SenseDataLength = (UINT8) (6 * sizeof (EFI_SCSI_SENSE_DATA)); - Request->SenseData = AllocateZeroPool (Request->SenseDataLength); + Request->SenseData = AllocateZeroPool(Request->SenseDataLength); if (Request->SenseData == NULL) { Status = EFI_OUT_OF_RESOURCES; goto ErrorExit; @@ -4643,7 +4643,7 @@ ScsiDiskAsyncRead16 ( AsyncIoEvent = NULL; - Request = AllocateZeroPool (sizeof (SCSI_ASYNC_RW_REQUEST)); + Request = AllocateZeroPool(sizeof (SCSI_ASYNC_RW_REQUEST)); if (Request == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -4653,7 +4653,7 @@ ScsiDiskAsyncRead16 ( gBS->RestoreTPL (OldTpl); Request->SenseDataLength = (UINT8) (6 * sizeof (EFI_SCSI_SENSE_DATA)); - Request->SenseData = AllocateZeroPool (Request->SenseDataLength); + Request->SenseData = AllocateZeroPool(Request->SenseDataLength); if (Request->SenseData == NULL) { Status = EFI_OUT_OF_RESOURCES; goto ErrorExit; @@ -4762,7 +4762,7 @@ ScsiDiskAsyncWrite16 ( AsyncIoEvent = NULL; - Request = AllocateZeroPool (sizeof (SCSI_ASYNC_RW_REQUEST)); + Request = AllocateZeroPool(sizeof (SCSI_ASYNC_RW_REQUEST)); if (Request == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -4772,7 +4772,7 @@ ScsiDiskAsyncWrite16 ( gBS->RestoreTPL (OldTpl); Request->SenseDataLength = (UINT8) (6 * sizeof (EFI_SCSI_SENSE_DATA)); - Request->SenseData = AllocateZeroPool (Request->SenseDataLength); + Request->SenseData = AllocateZeroPool(Request->SenseDataLength); if (Request->SenseData == NULL) { Status = EFI_OUT_OF_RESOURCES; goto ErrorExit; diff --git a/MdeModulePkg/Bus/Sd/EmmcBlockIoPei/EmmcHci.c b/MdeModulePkg/Bus/Sd/EmmcBlockIoPei/EmmcHci.c index 00b147fc8..57d44b8fa 100644 --- a/MdeModulePkg/Bus/Sd/EmmcBlockIoPei/EmmcHci.c +++ b/MdeModulePkg/Bus/Sd/EmmcBlockIoPei/EmmcHci.c @@ -1003,7 +1003,7 @@ EmmcPeimCreateTrb ( return NULL; } - Trb = AllocateZeroPool (sizeof (EMMC_TRB)); + Trb = AllocateZeroPool(sizeof (EMMC_TRB)); if (Trb == NULL) { return NULL; } diff --git a/MdeModulePkg/Bus/Sd/EmmcDxe/EmmcBlockIo.c b/MdeModulePkg/Bus/Sd/EmmcDxe/EmmcBlockIo.c index 37e719f65..e2b09d6a6 100644 --- a/MdeModulePkg/Bus/Sd/EmmcDxe/EmmcBlockIo.c +++ b/MdeModulePkg/Bus/Sd/EmmcDxe/EmmcBlockIo.c @@ -326,7 +326,7 @@ EmmcSetExtCsd ( Device = Partition->Device; PassThru = Device->Private->PassThru; - SetExtCsdReq = AllocateZeroPool (sizeof (EMMC_REQUEST)); + SetExtCsdReq = AllocateZeroPool(sizeof (EMMC_REQUEST)); if (SetExtCsdReq == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Error; @@ -432,7 +432,7 @@ EmmcSetBlkCount ( Device = Partition->Device; PassThru = Device->Private->PassThru; - SetBlkCntReq = AllocateZeroPool (sizeof (EMMC_REQUEST)); + SetBlkCntReq = AllocateZeroPool(sizeof (EMMC_REQUEST)); if (SetBlkCntReq == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Error; @@ -549,7 +549,7 @@ EmmcProtocolInOut ( Device = Partition->Device; PassThru = Device->Private->PassThru; - ProtocolReq = AllocateZeroPool (sizeof (EMMC_REQUEST)); + ProtocolReq = AllocateZeroPool(sizeof (EMMC_REQUEST)); if (ProtocolReq == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Error; @@ -675,7 +675,7 @@ EmmcRwMultiBlocks ( Device = Partition->Device; PassThru = Device->Private->PassThru; - RwMultiBlkReq = AllocateZeroPool (sizeof (EMMC_REQUEST)); + RwMultiBlkReq = AllocateZeroPool(sizeof (EMMC_REQUEST)); if (RwMultiBlkReq == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Error; @@ -1619,7 +1619,7 @@ EmmcEraseBlockStart ( Device = Partition->Device; PassThru = Device->Private->PassThru; - EraseBlockStart = AllocateZeroPool (sizeof (EMMC_REQUEST)); + EraseBlockStart = AllocateZeroPool(sizeof (EMMC_REQUEST)); if (EraseBlockStart == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Error; @@ -1726,7 +1726,7 @@ EmmcEraseBlockEnd ( Device = Partition->Device; PassThru = Device->Private->PassThru; - EraseBlockEnd = AllocateZeroPool (sizeof (EMMC_REQUEST)); + EraseBlockEnd = AllocateZeroPool(sizeof (EMMC_REQUEST)); if (EraseBlockEnd == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Error; @@ -1831,7 +1831,7 @@ EmmcEraseBlock ( Device = Partition->Device; PassThru = Device->Private->PassThru; - EraseBlock = AllocateZeroPool (sizeof (EMMC_REQUEST)); + EraseBlock = AllocateZeroPool(sizeof (EMMC_REQUEST)); if (EraseBlock == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Error; @@ -1931,7 +1931,7 @@ EmmcWriteZeros ( UINT8 *Buffer; UINT32 MediaId; - Buffer = AllocateZeroPool (Size); + Buffer = AllocateZeroPool(Size); if (Buffer == NULL) { return EFI_OUT_OF_RESOURCES; } diff --git a/MdeModulePkg/Bus/Sd/EmmcDxe/EmmcDxe.c b/MdeModulePkg/Bus/Sd/EmmcDxe/EmmcDxe.c index 6115511f4..b3eeb642d 100644 --- a/MdeModulePkg/Bus/Sd/EmmcDxe/EmmcDxe.c +++ b/MdeModulePkg/Bus/Sd/EmmcDxe/EmmcDxe.c @@ -847,7 +847,7 @@ EmmcDxeDriverBindingStart ( // Check EFI_ALREADY_STARTED to reuse the original EMMC_DRIVER_PRIVATE_DATA. // if (Status != EFI_ALREADY_STARTED) { - Private = AllocateZeroPool (sizeof (EMMC_DRIVER_PRIVATE_DATA)); + Private = AllocateZeroPool(sizeof (EMMC_DRIVER_PRIVATE_DATA)); if (Private == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Error; diff --git a/MdeModulePkg/Bus/Sd/SdBlockIoPei/SdHci.c b/MdeModulePkg/Bus/Sd/SdBlockIoPei/SdHci.c index c18d1d114..fdb9acea5 100644 --- a/MdeModulePkg/Bus/Sd/SdBlockIoPei/SdHci.c +++ b/MdeModulePkg/Bus/Sd/SdBlockIoPei/SdHci.c @@ -1003,7 +1003,7 @@ SdPeimCreateTrb ( return NULL; } - Trb = AllocateZeroPool (sizeof (SD_TRB)); + Trb = AllocateZeroPool(sizeof (SD_TRB)); if (Trb == NULL) { return NULL; } diff --git a/MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c b/MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c index 965dbeb3a..a84b1f546 100644 --- a/MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c +++ b/MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c @@ -327,7 +327,7 @@ SdRwSingleBlock ( RwSingleBlkReq = NULL; PassThru = Device->Private->PassThru; - RwSingleBlkReq = AllocateZeroPool (sizeof (SD_REQUEST)); + RwSingleBlkReq = AllocateZeroPool(sizeof (SD_REQUEST)); if (RwSingleBlkReq == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Error; @@ -459,7 +459,7 @@ SdRwMultiBlocks ( PassThru = Device->Private->PassThru; - RwMultiBlkReq = AllocateZeroPool (sizeof (SD_REQUEST)); + RwMultiBlkReq = AllocateZeroPool(sizeof (SD_REQUEST)); if (RwMultiBlkReq == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Error; @@ -1003,7 +1003,7 @@ SdEraseBlockStart ( EraseBlockStart = NULL; PassThru = Device->Private->PassThru; - EraseBlockStart = AllocateZeroPool (sizeof (SD_REQUEST)); + EraseBlockStart = AllocateZeroPool(sizeof (SD_REQUEST)); if (EraseBlockStart == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Error; @@ -1107,7 +1107,7 @@ SdEraseBlockEnd ( EraseBlockEnd = NULL; PassThru = Device->Private->PassThru; - EraseBlockEnd = AllocateZeroPool (sizeof (SD_REQUEST)); + EraseBlockEnd = AllocateZeroPool(sizeof (SD_REQUEST)); if (EraseBlockEnd == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Error; @@ -1209,7 +1209,7 @@ SdEraseBlock ( EraseBlock = NULL; PassThru = Device->Private->PassThru; - EraseBlock = AllocateZeroPool (sizeof (SD_REQUEST)); + EraseBlock = AllocateZeroPool(sizeof (SD_REQUEST)); if (EraseBlock == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Error; diff --git a/MdeModulePkg/Bus/Sd/SdDxe/SdDxe.c b/MdeModulePkg/Bus/Sd/SdDxe/SdDxe.c index 157aec4df..50a3df4ca 100644 --- a/MdeModulePkg/Bus/Sd/SdDxe/SdDxe.c +++ b/MdeModulePkg/Bus/Sd/SdDxe/SdDxe.c @@ -598,7 +598,7 @@ SdDxeDriverBindingStart ( // Check EFI_ALREADY_STARTED to reuse the original SD_DRIVER_PRIVATE_DATA. // if (Status != EFI_ALREADY_STARTED) { - Private = AllocateZeroPool (sizeof (SD_DRIVER_PRIVATE_DATA)); + Private = AllocateZeroPool(sizeof (SD_DRIVER_PRIVATE_DATA)); if (Private == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Error; diff --git a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c index 1790b565c..e37f11c61 100644 --- a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c +++ b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c @@ -1488,7 +1488,7 @@ UfsExecScsiCmds ( UFS_PASS_THRU_TRANS_REQ *TransReq; EDKII_UFS_HOST_CONTROLLER_PROTOCOL *UfsHc; - TransReq = AllocateZeroPool (sizeof (UFS_PASS_THRU_TRANS_REQ)); + TransReq = AllocateZeroPool(sizeof (UFS_PASS_THRU_TRANS_REQ)); if (TransReq == NULL) { return EFI_OUT_OF_RESOURCES; } diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c index 417120e35..bed26a7bc 100644 --- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c +++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c @@ -780,7 +780,7 @@ UsbIoGetStringDescriptor ( goto FREE_STR; } - Buf = AllocateZeroPool (StrDesc->Length); + Buf = AllocateZeroPool(StrDesc->Length); if (Buf == NULL) { Status = EFI_OUT_OF_RESOURCES; @@ -914,7 +914,7 @@ UsbBusBuildProtocol ( EFI_STATUS Status; EFI_STATUS Status2; - UsbBus = AllocateZeroPool (sizeof (USB_BUS)); + UsbBus = AllocateZeroPool(sizeof (USB_BUS)); if (UsbBus == NULL) { return EFI_OUT_OF_RESOURCES; @@ -1008,14 +1008,14 @@ UsbBusBuildProtocol ( // // Create a fake usb device for root hub // - RootHub = AllocateZeroPool (sizeof (USB_DEVICE)); + RootHub = AllocateZeroPool(sizeof (USB_DEVICE)); if (RootHub == NULL) { Status = EFI_OUT_OF_RESOURCES; goto UNINSTALL_USBBUS; } - RootIf = AllocateZeroPool (sizeof (USB_INTERFACE)); + RootIf = AllocateZeroPool(sizeof (USB_INTERFACE)); if (RootIf == NULL) { FreePool(RootHub); diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.c b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.c index f8d39c021..bc8aed603 100644 --- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.c +++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.c @@ -231,7 +231,7 @@ UsbCreateDesc ( return NULL; } - Desc = AllocateZeroPool ((UINTN) CtrlLen); + Desc = AllocateZeroPool((UINTN) CtrlLen); if (Desc == NULL) { return NULL; } @@ -290,7 +290,7 @@ UsbParseInterfaceDesc ( goto ON_EXIT; } - Setting->Endpoints = AllocateZeroPool (sizeof (USB_ENDPOINT_DESC *) * NumEp); + Setting->Endpoints = AllocateZeroPool(sizeof (USB_ENDPOINT_DESC *) * NumEp); if (Setting->Endpoints == NULL) { goto ON_ERROR; @@ -356,7 +356,7 @@ UsbParseConfigDesc ( // Initialize an array of setting for the configuration's interfaces. // NumIf = Config->Desc.NumInterfaces; - Config->Interfaces = AllocateZeroPool (sizeof (USB_INTERFACE_DESC *) * NumIf); + Config->Interfaces = AllocateZeroPool(sizeof (USB_INTERFACE_DESC *) * NumIf); if (Config->Interfaces == NULL) { goto ON_ERROR; @@ -366,7 +366,7 @@ UsbParseConfigDesc ( Config->Desc.ConfigurationValue, (UINT32)NumIf)); for (Index = 0; Index < NumIf; Index++) { - Interface = AllocateZeroPool (sizeof (USB_INTERFACE_DESC)); + Interface = AllocateZeroPool(sizeof (USB_INTERFACE_DESC)); if (Interface == NULL) { goto ON_ERROR; @@ -597,7 +597,7 @@ UsbGetDevDesc ( USB_DEVICE_DESC *DevDesc; EFI_STATUS Status; - DevDesc = AllocateZeroPool (sizeof (USB_DEVICE_DESC)); + DevDesc = AllocateZeroPool(sizeof (USB_DEVICE_DESC)); if (DevDesc == NULL) { return EFI_OUT_OF_RESOURCES; @@ -660,7 +660,7 @@ UsbGetOneString ( return NULL; } - Buf = AllocateZeroPool (Desc.Length); + Buf = AllocateZeroPool(Desc.Length); if (Buf == NULL) { return NULL; @@ -780,7 +780,7 @@ UsbGetOneConfig ( return NULL; } - Buf = AllocateZeroPool (Desc.TotalLength); + Buf = AllocateZeroPool(Desc.TotalLength); if (Buf == NULL) { return NULL; @@ -839,7 +839,7 @@ UsbBuildDescTable ( return EFI_DEVICE_ERROR; } - DevDesc->Configs = AllocateZeroPool (NumConfig * sizeof (USB_CONFIG_DESC *)); + DevDesc->Configs = AllocateZeroPool(NumConfig * sizeof (USB_CONFIG_DESC *)); if (DevDesc->Configs == NULL) { return EFI_OUT_OF_RESOURCES; } diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c index 756717679..6c344159f 100644 --- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c +++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c @@ -98,7 +98,7 @@ UsbCreateInterface ( USB_INTERFACE *HubIf; EFI_STATUS Status; - UsbIf = AllocateZeroPool (sizeof (USB_INTERFACE)); + UsbIf = AllocateZeroPool(sizeof (USB_INTERFACE)); if (UsbIf == NULL) { return NULL; @@ -221,7 +221,7 @@ UsbCreateDevice ( ASSERT (ParentIf != NULL); - Device = AllocateZeroPool (sizeof (USB_DEVICE)); + Device = AllocateZeroPool(sizeof (USB_DEVICE)); if (Device == NULL) { return NULL; diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbHub.c b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbHub.c index 0ab357b8b..315bac7f3 100644 --- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbHub.c +++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbHub.c @@ -547,7 +547,7 @@ UsbOnHubInterrupt ( // practise since UsbOnHubInterrupt is called in the context // of host contrller's AsyncInterrupt monitor. // - HubIf->ChangeMap = AllocateZeroPool (DataLength); + HubIf->ChangeMap = AllocateZeroPool(DataLength); if (HubIf->ChangeMap == NULL) { return EFI_OUT_OF_RESOURCES; diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbUtility.c b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbUtility.c index d11c8c25e..94b3cd62d 100644 --- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbUtility.c +++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbUtility.c @@ -641,7 +641,7 @@ GetUsbDPFromFullDP ( // // Create a new device path which only contain the above Usb part // - UsbDevicePathPtr = AllocateZeroPool (Size + sizeof (EFI_DEVICE_PATH_PROTOCOL)); + UsbDevicePathPtr = AllocateZeroPool(Size + sizeof (EFI_DEVICE_PATH_PROTOCOL)); ASSERT (UsbDevicePathPtr != NULL); CopyMem (UsbDevicePathPtr, UsbDevicePathBeginPtr, Size); // @@ -736,7 +736,7 @@ AddUsbDPToList ( // // Prepare the usbio device path DEVICE_PATH_LIST_ITEM structure. // - ListItem = AllocateZeroPool (sizeof (DEVICE_PATH_LIST_ITEM)); + ListItem = AllocateZeroPool(sizeof (DEVICE_PATH_LIST_ITEM)); ASSERT (ListItem != NULL); ListItem->Signature = DEVICE_PATH_LIST_ITEM_SIGNATURE; ListItem->DevicePath = DuplicateDevicePath (UsbDP); diff --git a/MdeModulePkg/Bus/Usb/UsbKbDxe/EfiKey.c b/MdeModulePkg/Bus/Usb/UsbKbDxe/EfiKey.c index d219f4cd6..de30b7769 100644 --- a/MdeModulePkg/Bus/Usb/UsbKbDxe/EfiKey.c +++ b/MdeModulePkg/Bus/Usb/UsbKbDxe/EfiKey.c @@ -166,7 +166,7 @@ USBKeyboardDriverBindingStart ( goto ErrorExit1; } - UsbKeyboardDevice = AllocateZeroPool (sizeof (USB_KB_DEV)); + UsbKeyboardDevice = AllocateZeroPool(sizeof (USB_KB_DEV)); ASSERT (UsbKeyboardDevice != NULL); // @@ -1112,7 +1112,7 @@ USBKeyboardRegisterKeyNotify ( // // Allocate resource to save the notification function // - NewNotify = (KEYBOARD_CONSOLE_IN_EX_NOTIFY *) AllocateZeroPool (sizeof (KEYBOARD_CONSOLE_IN_EX_NOTIFY)); + NewNotify = (KEYBOARD_CONSOLE_IN_EX_NOTIFY *) AllocateZeroPool(sizeof (KEYBOARD_CONSOLE_IN_EX_NOTIFY)); if (NewNotify == NULL) { return EFI_OUT_OF_RESOURCES; } diff --git a/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c b/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c index dcaf0d7dd..f8d075436 100644 --- a/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c +++ b/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c @@ -611,7 +611,7 @@ SetKeyboardLayoutEvent ( // Re-allocate resource for KeyConvertionTable // ReleaseKeyboardLayoutResources (UsbKeyboardDevice); - UsbKeyboardDevice->KeyConvertionTable = AllocateZeroPool ((NUMBER_OF_VALID_USB_KEYCODE) * sizeof (EFI_KEY_DESCRIPTOR)); + UsbKeyboardDevice->KeyConvertionTable = AllocateZeroPool((NUMBER_OF_VALID_USB_KEYCODE) * sizeof (EFI_KEY_DESCRIPTOR)); ASSERT (UsbKeyboardDevice->KeyConvertionTable != NULL); // @@ -640,7 +640,7 @@ SetKeyboardLayoutEvent ( // For non-spacing key, create the list with a non-spacing key followed by physical keys. // if (TempKey.Modifier == EFI_NS_KEY_MODIFIER) { - UsbNsKey = AllocateZeroPool (sizeof (USB_NS_KEY)); + UsbNsKey = AllocateZeroPool(sizeof (USB_NS_KEY)); ASSERT (UsbNsKey != NULL); // @@ -738,7 +738,7 @@ InitKeyboardLayout ( EFI_HII_KEYBOARD_LAYOUT *KeyboardLayout; EFI_STATUS Status; - UsbKeyboardDevice->KeyConvertionTable = AllocateZeroPool ((NUMBER_OF_VALID_USB_KEYCODE) * sizeof (EFI_KEY_DESCRIPTOR)); + UsbKeyboardDevice->KeyConvertionTable = AllocateZeroPool((NUMBER_OF_VALID_USB_KEYCODE) * sizeof (EFI_KEY_DESCRIPTOR)); ASSERT (UsbKeyboardDevice->KeyConvertionTable != NULL); InitializeListHead (&UsbKeyboardDevice->NsKeyList); diff --git a/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBot.c b/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBot.c index 4aa832590..e1bb499e2 100644 --- a/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBot.c +++ b/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBot.c @@ -51,7 +51,7 @@ UsbBotInit ( // // Allocate the BOT context for USB_BOT_PROTOCOL and two endpoint descriptors. // - UsbBot = AllocateZeroPool (sizeof (USB_BOT_PROTOCOL) + 2 * sizeof (EFI_USB_ENDPOINT_DESCRIPTOR)); + UsbBot = AllocateZeroPool(sizeof (USB_BOT_PROTOCOL) + 2 * sizeof (EFI_USB_ENDPOINT_DESCRIPTOR)); ASSERT (UsbBot != NULL); UsbBot->UsbIo = UsbIo; diff --git a/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassCbi.c b/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassCbi.c index f83980398..8c2150ac3 100644 --- a/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassCbi.c +++ b/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassCbi.c @@ -65,7 +65,7 @@ UsbCbiInit ( // // Allocate the CBI context for USB_CBI_PROTOCOL and 3 endpoint descriptors. // - UsbCbi = AllocateZeroPool ( + UsbCbi = AllocateZeroPool( sizeof (USB_CBI_PROTOCOL) + 3 * sizeof (EFI_USB_ENDPOINT_DESCRIPTOR) ); ASSERT (UsbCbi != NULL); diff --git a/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassImpl.c b/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassImpl.c index 819546685..e923a2fc3 100644 --- a/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassImpl.c +++ b/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassImpl.c @@ -494,7 +494,7 @@ UsbMassInitMultiLun ( DEBUG ((EFI_D_INFO, "UsbMassInitMultiLun: Start to initialize No.%d logic unit\n", Index)); UsbIo = NULL; - UsbMass = AllocateZeroPool (sizeof (USB_MASS_DEVICE)); + UsbMass = AllocateZeroPool(sizeof (USB_MASS_DEVICE)); ASSERT (UsbMass != NULL); UsbMass->Signature = USB_MASS_SIGNATURE; @@ -620,7 +620,7 @@ UsbMassInitNonLun ( EFI_STATUS Status; UsbIo = NULL; - UsbMass = AllocateZeroPool (sizeof (USB_MASS_DEVICE)); + UsbMass = AllocateZeroPool(sizeof (USB_MASS_DEVICE)); ASSERT (UsbMass != NULL); Status = gBS->OpenProtocol ( diff --git a/MdeModulePkg/Bus/Usb/UsbMouseAbsolutePointerDxe/UsbMouseAbsolutePointer.c b/MdeModulePkg/Bus/Usb/UsbMouseAbsolutePointerDxe/UsbMouseAbsolutePointer.c index 4fc2adeeb..cfdf0c6cc 100644 --- a/MdeModulePkg/Bus/Usb/UsbMouseAbsolutePointerDxe/UsbMouseAbsolutePointer.c +++ b/MdeModulePkg/Bus/Usb/UsbMouseAbsolutePointerDxe/UsbMouseAbsolutePointer.c @@ -161,7 +161,7 @@ USBMouseAbsolutePointerDriverBindingStart ( goto ErrorExit1; } - UsbMouseAbsolutePointerDevice = AllocateZeroPool (sizeof (USB_MOUSE_ABSOLUTE_POINTER_DEV)); + UsbMouseAbsolutePointerDevice = AllocateZeroPool(sizeof (USB_MOUSE_ABSOLUTE_POINTER_DEV)); ASSERT (UsbMouseAbsolutePointerDevice != NULL); UsbMouseAbsolutePointerDevice->UsbIo = UsbIo; @@ -570,7 +570,7 @@ InitializeUsbMouseDevice ( // By issuing Get_Descriptor(Configuration) request with total length, we get the Configuration descriptor, // all Interface descriptors, all Endpoint descriptors, and the HID descriptor for each interface. // - Buf = AllocateZeroPool (ConfigDesc.TotalLength); + Buf = AllocateZeroPool(ConfigDesc.TotalLength); if (Buf == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -629,7 +629,7 @@ InitializeUsbMouseDevice ( return EFI_UNSUPPORTED; } - ReportDesc = AllocateZeroPool (MouseHidDesc->HidClassDesc[0].DescriptorLength); + ReportDesc = AllocateZeroPool(MouseHidDesc->HidClassDesc[0].DescriptorLength); ASSERT (ReportDesc != NULL); Status = UsbGetReportDescriptor ( diff --git a/MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouse.c b/MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouse.c index d1e295b94..402528812 100644 --- a/MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouse.c +++ b/MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouse.c @@ -161,7 +161,7 @@ USBMouseDriverBindingStart ( goto ErrorExit1; } - UsbMouseDevice = AllocateZeroPool (sizeof (USB_MOUSE_DEV)); + UsbMouseDevice = AllocateZeroPool(sizeof (USB_MOUSE_DEV)); ASSERT (UsbMouseDevice != NULL); UsbMouseDevice->UsbIo = UsbIo; @@ -570,7 +570,7 @@ InitializeUsbMouseDevice ( // By issuing Get_Descriptor(Configuration) request with total length, we get the Configuration descriptor, // all Interface descriptors, all Endpoint descriptors, and the HID descriptor for each interface. // - Buf = AllocateZeroPool (ConfigDesc.TotalLength); + Buf = AllocateZeroPool(ConfigDesc.TotalLength); if (Buf == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -629,7 +629,7 @@ InitializeUsbMouseDevice ( return EFI_UNSUPPORTED; } - ReportDesc = AllocateZeroPool (MouseHidDesc->HidClassDesc[0].DescriptorLength); + ReportDesc = AllocateZeroPool(MouseHidDesc->HidClassDesc[0].DescriptorLength); ASSERT (ReportDesc != NULL); Status = UsbGetReportDescriptor ( diff --git a/MdeModulePkg/Core/Dxe/Dispatcher/Dispatcher.c b/MdeModulePkg/Core/Dxe/Dispatcher/Dispatcher.c index 2f7fdbd45..57e72324a 100644 --- a/MdeModulePkg/Core/Dxe/Dispatcher/Dispatcher.c +++ b/MdeModulePkg/Core/Dxe/Dispatcher/Dispatcher.c @@ -775,7 +775,7 @@ FvIsBeingProcesssed ( } } - KnownHandle = AllocateZeroPool (sizeof (KNOWN_HANDLE)); + KnownHandle = AllocateZeroPool(sizeof (KNOWN_HANDLE)); ASSERT (KnownHandle != NULL); KnownHandle->Signature = KNOWN_HANDLE_SIGNATURE; @@ -874,7 +874,7 @@ CoreAddToDriverList ( // Create the Driver Entry for the list. ZeroPool initializes lots of variables to // NULL or FALSE. // - DriverEntry = AllocateZeroPool (sizeof (EFI_CORE_DRIVER_ENTRY)); + DriverEntry = AllocateZeroPool(sizeof (EFI_CORE_DRIVER_ENTRY)); ASSERT (DriverEntry != NULL); if (Type == EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE) { DriverEntry->IsFvImage = TRUE; diff --git a/MdeModulePkg/Core/Dxe/Event/Event.c b/MdeModulePkg/Core/Dxe/Event/Event.c index b47c2776b..ed763ec83 100644 --- a/MdeModulePkg/Core/Dxe/Event/Event.c +++ b/MdeModulePkg/Core/Dxe/Event/Event.c @@ -458,7 +458,7 @@ CoreCreateEventInternal ( if ((Type & EVT_RUNTIME) != 0) { IEvent = AllocateRuntimeZeroPool (sizeof (IEVENT)); } else { - IEvent = AllocateZeroPool (sizeof (IEVENT)); + IEvent = AllocateZeroPool(sizeof (IEVENT)); } if (IEvent == NULL) { return EFI_OUT_OF_RESOURCES; diff --git a/MdeModulePkg/Core/Dxe/FwVol/FwVol.c b/MdeModulePkg/Core/Dxe/FwVol/FwVol.c index d0a4b5e8b..dfdc37aa0 100644 --- a/MdeModulePkg/Core/Dxe/FwVol/FwVol.c +++ b/MdeModulePkg/Core/Dxe/FwVol/FwVol.c @@ -527,7 +527,7 @@ FvCheck ( // // Create a FFS list entry for each non-deleted file // - FfsFileEntry = AllocateZeroPool (sizeof (FFS_FILE_LIST_ENTRY)); + FfsFileEntry = AllocateZeroPool(sizeof (FFS_FILE_LIST_ENTRY)); if (FfsFileEntry == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Done; diff --git a/MdeModulePkg/Core/Dxe/Gcd/Gcd.c b/MdeModulePkg/Core/Dxe/Gcd/Gcd.c index fe9d12e51..0bfe0da83 100644 --- a/MdeModulePkg/Core/Dxe/Gcd/Gcd.c +++ b/MdeModulePkg/Core/Dxe/Gcd/Gcd.c @@ -390,14 +390,14 @@ CoreAllocateGcdMapEntry ( // cause problem when it's freed (if HeapGuard is enabled). // mOnGuarding = TRUE; - *TopEntry = AllocateZeroPool (sizeof (EFI_GCD_MAP_ENTRY)); + *TopEntry = AllocateZeroPool(sizeof (EFI_GCD_MAP_ENTRY)); mOnGuarding = FALSE; if (*TopEntry == NULL) { return EFI_OUT_OF_RESOURCES; } mOnGuarding = TRUE; - *BottomEntry = AllocateZeroPool (sizeof (EFI_GCD_MAP_ENTRY)); + *BottomEntry = AllocateZeroPool(sizeof (EFI_GCD_MAP_ENTRY)); mOnGuarding = FALSE; if (*BottomEntry == NULL) { CoreFreePool(*TopEntry); diff --git a/MdeModulePkg/Core/Dxe/Hand/DriverSupport.c b/MdeModulePkg/Core/Dxe/Hand/DriverSupport.c index 6daa40563..063522727 100644 --- a/MdeModulePkg/Core/Dxe/Hand/DriverSupport.c +++ b/MdeModulePkg/Core/Dxe/Hand/DriverSupport.c @@ -85,7 +85,7 @@ CoreConnectController ( if (RemainingDevicePath != NULL && !Recursive) { HandleFilePathSize = GetDevicePathSize (HandleFilePath) - sizeof (EFI_DEVICE_PATH_PROTOCOL); RemainingDevicePathSize = GetDevicePathSize (RemainingDevicePath); - TempFilePath = AllocateZeroPool (HandleFilePathSize + RemainingDevicePathSize); + TempFilePath = AllocateZeroPool(HandleFilePathSize + RemainingDevicePathSize); ASSERT (TempFilePath != NULL); CopyMem (TempFilePath, HandleFilePath, HandleFilePathSize); CopyMem ((UINT8 *) TempFilePath + HandleFilePathSize, RemainingDevicePath, RemainingDevicePathSize); diff --git a/MdeModulePkg/Core/Dxe/Hand/Handle.c b/MdeModulePkg/Core/Dxe/Hand/Handle.c index 16b6a82b5..7de4bd60d 100644 --- a/MdeModulePkg/Core/Dxe/Hand/Handle.c +++ b/MdeModulePkg/Core/Dxe/Hand/Handle.c @@ -393,7 +393,7 @@ CoreInstallProtocolInterfaceNotify ( // // Allocate a new protocol interface structure // - Prot = AllocateZeroPool (sizeof(PROTOCOL_INTERFACE)); + Prot = AllocateZeroPool(sizeof(PROTOCOL_INTERFACE)); if (Prot == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Done; @@ -404,7 +404,7 @@ CoreInstallProtocolInterfaceNotify ( // Handle = (IHANDLE *)*UserHandle; if (Handle == NULL) { - Handle = AllocateZeroPool (sizeof(IHANDLE)); + Handle = AllocateZeroPool(sizeof(IHANDLE)); if (Handle == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Done; diff --git a/MdeModulePkg/Core/Dxe/Image/Image.c b/MdeModulePkg/Core/Dxe/Image/Image.c index 5dd81be48..0739f0f07 100644 --- a/MdeModulePkg/Core/Dxe/Image/Image.c +++ b/MdeModulePkg/Core/Dxe/Image/Image.c @@ -159,7 +159,7 @@ PeCoffEmuProtocolNotify ( continue; } - Entry = AllocateZeroPool (sizeof (*Entry)); + Entry = AllocateZeroPool(sizeof (*Entry)); ASSERT (Entry != NULL); Entry->Emulator = Emulator; @@ -1304,7 +1304,7 @@ CoreLoadImageCommon ( // // Allocate a new image structure // - Image = AllocateZeroPool (sizeof(LOADED_IMAGE_PRIVATE_DATA)); + Image = AllocateZeroPool(sizeof(LOADED_IMAGE_PRIVATE_DATA)); if (Image == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Done; diff --git a/MdeModulePkg/Core/Dxe/Misc/DebugImageInfo.c b/MdeModulePkg/Core/Dxe/Misc/DebugImageInfo.c index 6bbd0a393..a88705e46 100644 --- a/MdeModulePkg/Core/Dxe/Misc/DebugImageInfo.c +++ b/MdeModulePkg/Core/Dxe/Misc/DebugImageInfo.c @@ -194,7 +194,7 @@ CoreNewDebugImageInfoEntry ( // Table is full, so re-allocate another page for a larger table... // TableSize = mMaxTableEntries * EFI_DEBUG_TABLE_ENTRY_SIZE; - NewTable = AllocateZeroPool (TableSize + EFI_PAGE_SIZE); + NewTable = AllocateZeroPool(TableSize + EFI_PAGE_SIZE); if (NewTable == NULL) { mDebugInfoTableHeader.UpdateStatus &= ~EFI_DEBUG_IMAGE_INFO_UPDATE_IN_PROGRESS; return; @@ -223,7 +223,7 @@ CoreNewDebugImageInfoEntry ( // // Allocate data for new entry // - Table[Index].NormalImage = AllocateZeroPool (sizeof (EFI_DEBUG_IMAGE_INFO_NORMAL)); + Table[Index].NormalImage = AllocateZeroPool(sizeof (EFI_DEBUG_IMAGE_INFO_NORMAL)); if (Table[Index].NormalImage != NULL) { // // Update the entry diff --git a/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c b/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c index 2e1e0e7e7..856052ccb 100644 --- a/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c +++ b/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c @@ -421,7 +421,7 @@ ProtectUefiImage ( return ; } - ImageRecord = AllocateZeroPool (sizeof(*ImageRecord)); + ImageRecord = AllocateZeroPool(sizeof(*ImageRecord)); if (ImageRecord == NULL) { return ; } diff --git a/MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction.c b/MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction.c index 27f3cebb2..f6a8c321b 100644 --- a/MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction.c +++ b/MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction.c @@ -693,7 +693,7 @@ CreateChildNode ( // // Allocate a new node // - *ChildNode = AllocateZeroPool (sizeof (CORE_SECTION_CHILD_NODE)); + *ChildNode = AllocateZeroPool(sizeof (CORE_SECTION_CHILD_NODE)); Node = *ChildNode; if (Node == NULL) { return EFI_OUT_OF_RESOURCES; diff --git a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c index 8ecba9448..2e8b26555 100644 --- a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c +++ b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c @@ -116,9 +116,9 @@ DiscoverPeimsAndOrderWithApriori ( // Record PeimCount, allocate buffer for PeimState and FvFileHandles. // CoreFileHandle->PeimCount = PeimCount; - CoreFileHandle->PeimState = AllocateZeroPool (sizeof (UINT8) * PeimCount); + CoreFileHandle->PeimState = AllocateZeroPool(sizeof (UINT8) * PeimCount); ASSERT (CoreFileHandle->PeimState != NULL); - CoreFileHandle->FvFileHandles = AllocateZeroPool (sizeof (EFI_PEI_FILE_HANDLE) * PeimCount); + CoreFileHandle->FvFileHandles = AllocateZeroPool(sizeof (EFI_PEI_FILE_HANDLE) * PeimCount); ASSERT (CoreFileHandle->FvFileHandles != NULL); // diff --git a/MdeModulePkg/Core/Pei/FwVol/FwVol.c b/MdeModulePkg/Core/Pei/FwVol/FwVol.c index facd74daa..3ddd3a280 100644 --- a/MdeModulePkg/Core/Pei/FwVol/FwVol.c +++ b/MdeModulePkg/Core/Pei/FwVol/FwVol.c @@ -497,7 +497,7 @@ PeiInitializeFv ( ); ASSERT_EFI_ERROR(Status); - PrivateData->Fv = AllocateZeroPool (sizeof (PEI_CORE_FV_HANDLE) * FV_GROWTH_STEP); + PrivateData->Fv = AllocateZeroPool(sizeof (PEI_CORE_FV_HANDLE) * FV_GROWTH_STEP); ASSERT (PrivateData->Fv != NULL); PrivateData->MaxFvCount = FV_GROWTH_STEP; @@ -629,7 +629,7 @@ FirmwareVolmeInfoPpiNotifyCallback ( // // Run out of room, grow the buffer. // - TempPtr = AllocateZeroPool ( + TempPtr = AllocateZeroPool( sizeof (PEI_CORE_FV_HANDLE) * (PrivateData->MaxFvCount + FV_GROWTH_STEP) ); ASSERT (TempPtr != NULL); @@ -2213,7 +2213,7 @@ AddUnknownFormatFvInfo ( // // Run out of room, grow the buffer. // - TempPtr = AllocateZeroPool ( + TempPtr = AllocateZeroPool( sizeof (PEI_CORE_UNKNOW_FORMAT_FV_INFO) * (PrivateData->MaxUnknownFvInfoCount + FV_GROWTH_STEP) ); ASSERT (TempPtr != NULL); @@ -2366,7 +2366,7 @@ ThirdPartyFvPpiNotifyCallback ( // // Run out of room, grow the buffer. // - TempPtr = AllocateZeroPool ( + TempPtr = AllocateZeroPool( sizeof (PEI_CORE_FV_HANDLE) * (PrivateData->MaxFvCount + FV_GROWTH_STEP) ); ASSERT (TempPtr != NULL); diff --git a/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c b/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c index a8e212c43..545edfece 100644 --- a/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c +++ b/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c @@ -311,7 +311,7 @@ PeiCore ( // if Loading Module at Fixed Address is enabled, allocate the PEI code memory range usage bit map array. // Every bit in the array indicate the status of the corresponding memory page available or not // - OldCoreData->PeiCodeMemoryRangeUsageBitMap = AllocateZeroPool (((PcdGet32(PcdLoadFixAddressPeiCodePageNumber)>>6) + 1)*sizeof(UINT64)); + OldCoreData->PeiCodeMemoryRangeUsageBitMap = AllocateZeroPool(((PcdGet32(PcdLoadFixAddressPeiCodePageNumber)>>6) + 1)*sizeof(UINT64)); } // diff --git a/MdeModulePkg/Core/Pei/Ppi/Ppi.c b/MdeModulePkg/Core/Pei/Ppi/Ppi.c index be1939432..d0b774793 100644 --- a/MdeModulePkg/Core/Pei/Ppi/Ppi.c +++ b/MdeModulePkg/Core/Pei/Ppi/Ppi.c @@ -261,7 +261,7 @@ InternalPeiInstallPpi ( // // Run out of room, grow the buffer. // - TempPtr = AllocateZeroPool ( + TempPtr = AllocateZeroPool( sizeof (PEI_PPI_LIST_POINTERS) * (PpiListPointer->MaxCount + PPI_GROWTH_STEP) ); ASSERT (TempPtr != NULL); @@ -549,7 +549,7 @@ InternalPeiNotifyPpi ( // // Run out of room, grow the buffer. // - TempPtr = AllocateZeroPool ( + TempPtr = AllocateZeroPool( sizeof (PEI_PPI_LIST_POINTERS) * (CallbackNotifyListPointer->MaxCount + CALLBACK_NOTIFY_GROWTH_STEP) ); ASSERT (TempPtr != NULL); @@ -569,7 +569,7 @@ InternalPeiNotifyPpi ( // // Run out of room, grow the buffer. // - TempPtr = AllocateZeroPool ( + TempPtr = AllocateZeroPool( sizeof (PEI_PPI_LIST_POINTERS) * (DispatchNotifyListPointer->MaxCount + DISPATCH_NOTIFY_GROWTH_STEP) ); ASSERT (TempPtr != NULL); diff --git a/MdeModulePkg/Core/PiSmmCore/Dispatcher.c b/MdeModulePkg/Core/PiSmmCore/Dispatcher.c index 1f2b157d3..82710ecea 100644 --- a/MdeModulePkg/Core/PiSmmCore/Dispatcher.c +++ b/MdeModulePkg/Core/PiSmmCore/Dispatcher.c @@ -1196,7 +1196,7 @@ SmmAddToDriverList ( // Create the Driver Entry for the list. ZeroPool initializes lots of variables to // NULL or FALSE. // - DriverEntry = AllocateZeroPool (sizeof (EFI_SMM_DRIVER_ENTRY)); + DriverEntry = AllocateZeroPool(sizeof (EFI_SMM_DRIVER_ENTRY)); ASSERT (DriverEntry != NULL); DriverEntry->Signature = EFI_SMM_DRIVER_ENTRY_SIGNATURE; diff --git a/MdeModulePkg/Core/PiSmmCore/Handle.c b/MdeModulePkg/Core/PiSmmCore/Handle.c index cf823199a..82a00076b 100644 --- a/MdeModulePkg/Core/PiSmmCore/Handle.c +++ b/MdeModulePkg/Core/PiSmmCore/Handle.c @@ -253,7 +253,7 @@ SmmInstallProtocolInterfaceNotify ( // // Allocate a new protocol interface structure // - Prot = AllocateZeroPool (sizeof(PROTOCOL_INTERFACE)); + Prot = AllocateZeroPool(sizeof(PROTOCOL_INTERFACE)); if (Prot == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Done; @@ -264,7 +264,7 @@ SmmInstallProtocolInterfaceNotify ( // Handle = (IHANDLE *)*UserHandle; if (Handle == NULL) { - Handle = AllocateZeroPool (sizeof(IHANDLE)); + Handle = AllocateZeroPool(sizeof(IHANDLE)); if (Handle == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Done; diff --git a/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c b/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c index c86173dba..8f0fbedc2 100644 --- a/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c +++ b/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c @@ -1371,7 +1371,7 @@ GetFullSmramRanges ( // *FullSmramRangeCount = SmramRangeCount + AdditionSmramRangeCount; Size = (*FullSmramRangeCount) * sizeof (EFI_SMRAM_DESCRIPTOR); - FullSmramRanges = (EFI_SMRAM_DESCRIPTOR *) AllocateZeroPool (Size); + FullSmramRanges = (EFI_SMRAM_DESCRIPTOR *) AllocateZeroPool(Size); ASSERT (FullSmramRanges != NULL); Status = mSmmAccess->GetCapabilities (mSmmAccess, &Size, FullSmramRanges); @@ -1483,7 +1483,7 @@ GetFullSmramRanges ( // // Sort the entries // - FullSmramRanges = AllocateZeroPool ((TempSmramRangeCount + AdditionSmramRangeCount) * sizeof (EFI_SMRAM_DESCRIPTOR)); + FullSmramRanges = AllocateZeroPool((TempSmramRangeCount + AdditionSmramRangeCount) * sizeof (EFI_SMRAM_DESCRIPTOR)); ASSERT (FullSmramRanges != NULL); *FullSmramRangeCount = 0; do { diff --git a/MdeModulePkg/Core/PiSmmCore/Smi.c b/MdeModulePkg/Core/PiSmmCore/Smi.c index 4ffcbfd66..41ecc311b 100644 --- a/MdeModulePkg/Core/PiSmmCore/Smi.c +++ b/MdeModulePkg/Core/PiSmmCore/Smi.c @@ -220,7 +220,7 @@ SmiHandlerRegister ( return EFI_INVALID_PARAMETER; } - SmiHandler = AllocateZeroPool (sizeof (SMI_HANDLER)); + SmiHandler = AllocateZeroPool(sizeof (SMI_HANDLER)); if (SmiHandler == NULL) { return EFI_OUT_OF_RESOURCES; } diff --git a/MdeModulePkg/Core/PiSmmCore/SmiHandlerProfile.c b/MdeModulePkg/Core/PiSmmCore/SmiHandlerProfile.c index 08f6356e7..ea589e073 100644 --- a/MdeModulePkg/Core/PiSmmCore/SmiHandlerProfile.c +++ b/MdeModulePkg/Core/PiSmmCore/SmiHandlerProfile.c @@ -266,7 +266,7 @@ GetSmmLoadedImage( if (Status != EFI_BUFFER_TOO_SMALL) { return; } - HandleBuffer = AllocateZeroPool (HandleBufferSize); + HandleBuffer = AllocateZeroPool(HandleBufferSize); if (HandleBuffer == NULL) { return; } @@ -1198,7 +1198,7 @@ SmiHandlerProfileRegisterHandler ( return EFI_INVALID_PARAMETER; } - SmiHandler = AllocateZeroPool (sizeof (SMI_HANDLER)); + SmiHandler = AllocateZeroPool(sizeof (SMI_HANDLER)); if (SmiHandler == NULL) { return EFI_OUT_OF_RESOURCES; } diff --git a/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c b/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c index d9d0a92b9..59fae41f4 100644 --- a/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c +++ b/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c @@ -534,7 +534,7 @@ TranslateGopBltToBmp ( // reclaim the memory // if (*BmpImage == NULL) { - *BmpImage = AllocateZeroPool (BmpSize); + *BmpImage = AllocateZeroPool(BmpSize); if (*BmpImage == NULL) { return EFI_OUT_OF_RESOURCES; } diff --git a/MdeModulePkg/Library/BaseMemoryAllocationLibNull/BaseMemoryAllocationLibNull.c b/MdeModulePkg/Library/BaseMemoryAllocationLibNull/BaseMemoryAllocationLibNull.c index 34fec5cf0..bda37638b 100644 --- a/MdeModulePkg/Library/BaseMemoryAllocationLibNull/BaseMemoryAllocationLibNull.c +++ b/MdeModulePkg/Library/BaseMemoryAllocationLibNull/BaseMemoryAllocationLibNull.c @@ -308,7 +308,7 @@ AllocateReservedPool ( **/ VOID * EFIAPI -AllocateZeroPool ( +AllocateZeroPool( IN UINTN AllocationSize ) { diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c index e1457d99d..c871e3e25 100644 --- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c +++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c @@ -494,7 +494,7 @@ UpdateProgress( // Length = StrLen (L"&OFFSET=") + 4 + 1; - StringPtr = AllocateZeroPool (Length * sizeof (CHAR16)); + StringPtr = AllocateZeroPool(Length * sizeof (CHAR16)); if (StringPtr == NULL) { return NULL; @@ -691,7 +691,7 @@ BootMaintExtractConfig ( // ConfigRequestHdr = HiiConstructConfigHdr (&mBootMaintGuid, mBootMaintStorageName, Private->BmmDriverHandle); Size = (StrLen (ConfigRequestHdr) + 32 + 1) * sizeof (CHAR16); - ConfigRequest = AllocateZeroPool (Size); + ConfigRequest = AllocateZeroPool(Size); ASSERT (ConfigRequest != NULL); AllocatedRequest = TRUE; UnicodeSPrint (ConfigRequest, Size, L"%s&OFFSET=0&WIDTH=%016LX", ConfigRequestHdr, (UINT64)BufferSize); @@ -1688,7 +1688,7 @@ BootMaintenanceManagerUiLibConstructor ( // // Create LoadOption in BmmCallbackInfo for Driver Callback // - Ptr = AllocateZeroPool (sizeof (BM_LOAD_CONTEXT) + sizeof (BM_FILE_CONTEXT) + sizeof (BM_HANDLE_CONTEXT) + sizeof (BM_MENU_ENTRY)); + Ptr = AllocateZeroPool(sizeof (BM_LOAD_CONTEXT) + sizeof (BM_FILE_CONTEXT) + sizeof (BM_HANDLE_CONTEXT) + sizeof (BM_MENU_ENTRY)); ASSERT (Ptr != NULL); // diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerCustomizedUiSupport.c b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerCustomizedUiSupport.c index 37fe82232..5d6aa3859 100644 --- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerCustomizedUiSupport.c +++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerCustomizedUiSupport.c @@ -383,7 +383,7 @@ BmmListThirdPartyDrivers ( HiiHandles = HiiGetHiiHandles (NULL); ASSERT (HiiHandles != NULL); - gHiiDriverList = AllocateZeroPool (UI_HII_DRIVER_LIST_SIZE * sizeof (UI_HII_DRIVER_INSTANCE)); + gHiiDriverList = AllocateZeroPool(UI_HII_DRIVER_LIST_SIZE * sizeof (UI_HII_DRIVER_INSTANCE)); ASSERT (gHiiDriverList != NULL); DriverListPtr = gHiiDriverList; CurrentSize = UI_HII_DRIVER_LIST_SIZE; diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootOption.c b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootOption.c index f5c7d4374..b16e7d68d 100644 --- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootOption.c +++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootOption.c @@ -42,9 +42,9 @@ BmmSetupResetReminder ( //check any reset required change is applied? if yes, reset system // if (!EFI_ERROR(Status) && FormBrowserEx2->IsResetRequired()) { - StringBuffer1 = AllocateZeroPool (MAX_CHAR * sizeof (CHAR16)); + StringBuffer1 = AllocateZeroPool(MAX_CHAR * sizeof (CHAR16)); ASSERT (StringBuffer1 != NULL); - StringBuffer2 = AllocateZeroPool (MAX_CHAR * sizeof (CHAR16)); + StringBuffer2 = AllocateZeroPool(MAX_CHAR * sizeof (CHAR16)); ASSERT (StringBuffer2 != NULL); StrCpyS (StringBuffer1, MAX_CHAR, L"Configuration changed. Reset to apply it Now."); StrCpyS (StringBuffer2, MAX_CHAR, L"Press ENTER to reset"); @@ -115,12 +115,12 @@ BOpt_CreateMenuEntry ( // // Create new menu entry // - MenuEntry = AllocateZeroPool (sizeof (BM_MENU_ENTRY)); + MenuEntry = AllocateZeroPool(sizeof (BM_MENU_ENTRY)); if (MenuEntry == NULL) { return NULL; } - MenuEntry->VariableContext = AllocateZeroPool (ContextSize); + MenuEntry->VariableContext = AllocateZeroPool(ContextSize); if (MenuEntry->VariableContext == NULL) { FreePool(MenuEntry); return NULL; @@ -412,7 +412,7 @@ BOpt_GetBootOptions ( StringSize = StrSize((UINT16*)LoadOptionPtr); - NewLoadContext->Description = AllocateZeroPool (StrSize((UINT16*)LoadOptionPtr)); + NewLoadContext->Description = AllocateZeroPool(StrSize((UINT16*)LoadOptionPtr)); ASSERT (NewLoadContext->Description != NULL); StrCpyS (NewLoadContext->Description, StrSize((UINT16*)LoadOptionPtr) / sizeof (UINT16), (UINT16*)LoadOptionPtr); @@ -422,7 +422,7 @@ BOpt_GetBootOptions ( LoadOptionPtr += StringSize; - NewLoadContext->FilePathList = AllocateZeroPool (NewLoadContext->FilePathListLength); + NewLoadContext->FilePathList = AllocateZeroPool(NewLoadContext->FilePathListLength); ASSERT (NewLoadContext->FilePathList != NULL); CopyMem ( NewLoadContext->FilePathList, @@ -442,7 +442,7 @@ BOpt_GetBootOptions ( StringSize - NewLoadContext->FilePathListLength; - NewLoadContext->OptionalData = AllocateZeroPool (OptionalDataSize); + NewLoadContext->OptionalData = AllocateZeroPool(OptionalDataSize); ASSERT (NewLoadContext->OptionalData != NULL); CopyMem ( NewLoadContext->OptionalData, @@ -740,7 +740,7 @@ BOpt_GetDriverOptions ( LoadOptionPtr += sizeof (UINT16); StringSize = StrSize ((UINT16 *) LoadOptionPtr); - NewLoadContext->Description = AllocateZeroPool (StringSize); + NewLoadContext->Description = AllocateZeroPool(StringSize); ASSERT (NewLoadContext->Description != NULL); CopyMem ( NewLoadContext->Description, @@ -752,7 +752,7 @@ BOpt_GetDriverOptions ( LoadOptionPtr += StringSize; - NewLoadContext->FilePathList = AllocateZeroPool (NewLoadContext->FilePathListLength); + NewLoadContext->FilePathList = AllocateZeroPool(NewLoadContext->FilePathListLength); ASSERT (NewLoadContext->FilePathList != NULL); CopyMem ( NewLoadContext->FilePathList, @@ -772,7 +772,7 @@ BOpt_GetDriverOptions ( StringSize - NewLoadContext->FilePathListLength; - NewLoadContext->OptionalData = AllocateZeroPool (OptionalDataSize); + NewLoadContext->OptionalData = AllocateZeroPool(OptionalDataSize); ASSERT (NewLoadContext->OptionalData != NULL); CopyMem ( NewLoadContext->OptionalData, diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/UpdatePage.c b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/UpdatePage.c index 1c1465841..5593b45a1 100644 --- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/UpdatePage.c +++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/UpdatePage.c @@ -708,7 +708,7 @@ UpdateConModePage ( OptionsOpCodeHandle = HiiAllocateOpCodeHandle (); ASSERT (OptionsOpCodeHandle != NULL); - ModeToken = AllocateZeroPool (sizeof (EFI_STRING_ID) * ValidMode); + ModeToken = AllocateZeroPool(sizeof (EFI_STRING_ID) * ValidMode); ASSERT(ModeToken != NULL); // diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/Variable.c b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/Variable.c index b0326925b..86b448a24 100644 --- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/Variable.c +++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/Variable.c @@ -354,7 +354,7 @@ Var_UpdateDriverOption ( NewLoadContext->Attributes = LoadOption.Attributes; NewLoadContext->FilePathListLength = (UINT16)GetDevicePathSize (LoadOption.FilePath); - NewLoadContext->Description = AllocateZeroPool (StrSize (DescriptionData)); + NewLoadContext->Description = AllocateZeroPool(StrSize (DescriptionData)); ASSERT (NewLoadContext->Description != NULL); NewMenuEntry->DisplayString = NewLoadContext->Description; CopyMem ( @@ -363,7 +363,7 @@ Var_UpdateDriverOption ( StrSize (DescriptionData) ); - NewLoadContext->FilePathList = AllocateZeroPool (GetDevicePathSize (CallbackData->LoadContext->FilePathList)); + NewLoadContext->FilePathList = AllocateZeroPool(GetDevicePathSize (CallbackData->LoadContext->FilePathList)); ASSERT (NewLoadContext->FilePathList != NULL); CopyMem ( NewLoadContext->FilePathList, @@ -377,7 +377,7 @@ Var_UpdateDriverOption ( NewMenuEntry->HelpStringToken = HiiSetString (HiiHandle, 0, NewMenuEntry->HelpString, NULL); if (OptionalDataExist) { - NewLoadContext->OptionalData = AllocateZeroPool (LoadOption.OptionalDataSize); + NewLoadContext->OptionalData = AllocateZeroPool(LoadOption.OptionalDataSize); ASSERT (NewLoadContext->OptionalData != NULL); CopyMem ( NewLoadContext->OptionalData, @@ -472,7 +472,7 @@ Var_UpdateBootOption ( NewLoadContext->Attributes = LoadOption.Attributes; NewLoadContext->FilePathListLength = (UINT16) GetDevicePathSize (LoadOption.FilePath); - NewLoadContext->Description = AllocateZeroPool (StrSize (NvRamMap->BootDescriptionData)); + NewLoadContext->Description = AllocateZeroPool(StrSize (NvRamMap->BootDescriptionData)); ASSERT (NewLoadContext->Description != NULL); NewMenuEntry->DisplayString = NewLoadContext->Description; @@ -483,7 +483,7 @@ Var_UpdateBootOption ( StrSize (NvRamMap->BootDescriptionData) ); - NewLoadContext->FilePathList = AllocateZeroPool (GetDevicePathSize (CallbackData->LoadContext->FilePathList)); + NewLoadContext->FilePathList = AllocateZeroPool(GetDevicePathSize (CallbackData->LoadContext->FilePathList)); ASSERT (NewLoadContext->FilePathList != NULL); CopyMem ( NewLoadContext->FilePathList, @@ -497,7 +497,7 @@ Var_UpdateBootOption ( NewMenuEntry->HelpStringToken = HiiSetString (CallbackData->BmmHiiHandle, 0, NewMenuEntry->HelpString, NULL); if (OptionalDataExist) { - NewLoadContext->OptionalData = AllocateZeroPool (LoadOption.OptionalDataSize); + NewLoadContext->OptionalData = AllocateZeroPool(LoadOption.OptionalDataSize); ASSERT (NewLoadContext->OptionalData != NULL); CopyMem ( NewLoadContext->OptionalData, @@ -665,7 +665,7 @@ Var_UpdateDriverOrder ( // First check whether DriverOrder is present in current configuration // GetEfiGlobalVariable2 (L"DriverOrder", (VOID **) &DriverOrderList, &DriverOrderListSize); - NewDriverOrderList = AllocateZeroPool (DriverOrderListSize); + NewDriverOrderList = AllocateZeroPool(DriverOrderListSize); if (NewDriverOrderList == NULL) { return EFI_OUT_OF_RESOURCES; diff --git a/MdeModulePkg/Library/BootManagerUiLib/BootManager.c b/MdeModulePkg/Library/BootManagerUiLib/BootManager.c index 89d174a56..80f2df270 100644 --- a/MdeModulePkg/Library/BootManagerUiLib/BootManager.c +++ b/MdeModulePkg/Library/BootManagerUiLib/BootManager.c @@ -311,9 +311,9 @@ BmSetupResetReminder ( //check any reset required change is applied? if yes, reset system // if (!EFI_ERROR(Status) && FormBrowserEx2->IsResetRequired ()) { - StringBuffer1 = AllocateZeroPool (MAX_STRING_LEN * sizeof (CHAR16)); + StringBuffer1 = AllocateZeroPool(MAX_STRING_LEN * sizeof (CHAR16)); ASSERT (StringBuffer1 != NULL); - StringBuffer2 = AllocateZeroPool (MAX_STRING_LEN * sizeof (CHAR16)); + StringBuffer2 = AllocateZeroPool(MAX_STRING_LEN * sizeof (CHAR16)); ASSERT (StringBuffer2 != NULL); StrCpyS (StringBuffer1, MAX_STRING_LEN, L"Configuration changed. Reset to apply it Now."); StrCpyS (StringBuffer2, MAX_STRING_LEN, L"Press ENTER to reset"); @@ -578,7 +578,7 @@ UpdateBootManager ( TempStr = BmDevicePathToStr (BootOption[Index].FilePath); TempSize = StrSize (TempStr); - HelpString = AllocateZeroPool (TempSize + StrSize (L"Device Path : ")); + HelpString = AllocateZeroPool(TempSize + StrSize (L"Device Path : ")); MaxLen = (TempSize + StrSize (L"Device Path : "))/sizeof(CHAR16); ASSERT (HelpString != NULL); StrCatS (HelpString, MaxLen, L"Device Path : "); diff --git a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.c b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.c index 4727218be..a847fc449 100644 --- a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.c +++ b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.c @@ -721,7 +721,7 @@ ClearLines ( // // For now, allocate an arbitrarily long buffer // - Buffer = AllocateZeroPool (0x10000); + Buffer = AllocateZeroPool(0x10000); ASSERT (Buffer != NULL); if (!Buffer) { return; diff --git a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c index 90ad847c0..44d7b5d81 100644 --- a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c +++ b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c @@ -154,7 +154,7 @@ PrintFramework ( return; } - Buffer = AllocateZeroPool (0x10000); + Buffer = AllocateZeroPool(0x10000); ASSERT (Buffer != NULL); Character = BOXDRAW_HORIZONTAL; for (Index = 0; Index + 2 < (gScreenDimensions.RightColumn - gScreenDimensions.LeftColumn); Index++) { @@ -297,7 +297,7 @@ ProcessUserOpcode( // Initialize Driver private data // if (gBannerData == NULL) { - gBannerData = AllocateZeroPool (sizeof (BANNER_DATA)); + gBannerData = AllocateZeroPool(sizeof (BANNER_DATA)); ASSERT (gBannerData != NULL); } @@ -859,8 +859,8 @@ PrintInternal ( // // For now, allocate an arbitrarily long buffer // - Buffer = AllocateZeroPool (0x10000); - BackupBuffer = AllocateZeroPool (0x10000); + Buffer = AllocateZeroPool(0x10000); + BackupBuffer = AllocateZeroPool(0x10000); ASSERT (Buffer); ASSERT (BackupBuffer); diff --git a/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c b/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c index 5926089f1..14a4e64f7 100644 --- a/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c +++ b/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c @@ -128,7 +128,7 @@ GetMacAddressString( // The size is the Number size + ":" size + Vlan size(\XXXX) + End // BufferLen = (4 + 2 * HwAddressSize + (HwAddressSize - 1) + 5 + 1) * sizeof (CHAR16); - String = AllocateZeroPool (BufferLen); + String = AllocateZeroPool(BufferLen); if (String == NULL) { return FALSE; } diff --git a/MdeModulePkg/Library/DxeCapsuleLibFmp/CapsuleOnDisk.c b/MdeModulePkg/Library/DxeCapsuleLibFmp/CapsuleOnDisk.c index efcaf2c3f..4f92f76cf 100644 --- a/MdeModulePkg/Library/DxeCapsuleLibFmp/CapsuleOnDisk.c +++ b/MdeModulePkg/Library/DxeCapsuleLibFmp/CapsuleOnDisk.c @@ -1225,7 +1225,7 @@ BuildGatherList ( // // Allocate memory for the descriptors. // - BlockDescriptors1 = AllocateZeroPool (2 * sizeof (EFI_CAPSULE_BLOCK_DESCRIPTOR)); + BlockDescriptors1 = AllocateZeroPool(2 * sizeof (EFI_CAPSULE_BLOCK_DESCRIPTOR)); if (BlockDescriptors1 == NULL) { DEBUG ((DEBUG_ERROR, "BuildGatherList: failed to allocate memory for descriptors\n")); Status = EFI_OUT_OF_RESOURCES; @@ -1759,13 +1759,13 @@ RelocateCapsuleToRam ( // // 2. Add a capsule for Capsule file name strings // - CapsuleBuffer = AllocateZeroPool ((CapsuleOnDiskNum + 1) * sizeof (VOID *)); + CapsuleBuffer = AllocateZeroPool((CapsuleOnDiskNum + 1) * sizeof (VOID *)); if (CapsuleBuffer == NULL) { DEBUG ((DEBUG_ERROR, "Fail to allocate memory for capsules.\n")); return EFI_OUT_OF_RESOURCES; } - CapsuleSize = AllocateZeroPool ((CapsuleOnDiskNum + 1) * sizeof (UINTN)); + CapsuleSize = AllocateZeroPool((CapsuleOnDiskNum + 1) * sizeof (UINTN)); if (CapsuleSize == NULL) { DEBUG ((DEBUG_ERROR, "Fail to allocate memory for capsules.\n")); FreePool(CapsuleBuffer); @@ -1778,7 +1778,7 @@ RelocateCapsuleToRam ( TotalStringSize += StrSize (CapsuleOnDiskBuf[Index].FileInfo->FileName); } - FileNameCapsule = AllocateZeroPool (sizeof (EFI_CAPSULE_HEADER) + TotalStringSize); + FileNameCapsule = AllocateZeroPool(sizeof (EFI_CAPSULE_HEADER) + TotalStringSize); if (FileNameCapsule == NULL) { DEBUG ((DEBUG_ERROR, "Fail to allocate memory for name capsule.\n")); FreePool(CapsuleBuffer); diff --git a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c index b876fae18..2849a743e 100644 --- a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c +++ b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c @@ -582,7 +582,7 @@ DumpAllFmpInfo ( continue; } - FmpImageInfoBuf = AllocateZeroPool (ImageInfoSize); + FmpImageInfoBuf = AllocateZeroPool(ImageInfoSize); if (FmpImageInfoBuf == NULL) { continue; } @@ -694,7 +694,7 @@ GetFmpHandleBufferByType ( MatchedHandleBuffer = NULL; if (HandleBuf != NULL) { - MatchedHandleBuffer = AllocateZeroPool (sizeof(EFI_HANDLE) * NumberOfHandles); + MatchedHandleBuffer = AllocateZeroPool(sizeof(EFI_HANDLE) * NumberOfHandles); if (MatchedHandleBuffer == NULL) { FreePool(HandleBuffer); return EFI_OUT_OF_RESOURCES; @@ -703,7 +703,7 @@ GetFmpHandleBufferByType ( MatchedResetRequiredBuffer = NULL; if (ResetRequiredBuf != NULL) { - MatchedResetRequiredBuffer = AllocateZeroPool (sizeof(BOOLEAN) * NumberOfHandles); + MatchedResetRequiredBuffer = AllocateZeroPool(sizeof(BOOLEAN) * NumberOfHandles); if (MatchedResetRequiredBuffer == NULL) { if (MatchedHandleBuffer != NULL) { FreePool(MatchedHandleBuffer); @@ -738,7 +738,7 @@ GetFmpHandleBufferByType ( continue; } - FmpImageInfoBuf = AllocateZeroPool (ImageInfoSize); + FmpImageInfoBuf = AllocateZeroPool(ImageInfoSize); if (FmpImageInfoBuf == NULL) { continue; } @@ -855,7 +855,7 @@ GetFmpImageInfoDescriptorVer ( return 0; } - FmpImageInfoBuf = AllocateZeroPool (ImageInfoSize); + FmpImageInfoBuf = AllocateZeroPool(ImageInfoSize); if (FmpImageInfoBuf == NULL) { return 0; } diff --git a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleProcessLib.c b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleProcessLib.c index 7771a8437..12cbacfe2 100644 --- a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleProcessLib.c +++ b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleProcessLib.c @@ -257,13 +257,13 @@ InitCapsulePtr ( // // Init temp Capsule Data table. // - mCapsulePtr = (VOID **) AllocateZeroPool (sizeof (VOID *) * mCapsuleTotalNumber); + mCapsulePtr = (VOID **) AllocateZeroPool(sizeof (VOID *) * mCapsuleTotalNumber); if (mCapsulePtr == NULL) { DEBUG ((DEBUG_ERROR, "Allocate mCapsulePtr fail!\n")); mCapsuleTotalNumber = 0; return ; } - mCapsuleStatusArray = (EFI_STATUS *) AllocateZeroPool (sizeof (EFI_STATUS) * mCapsuleTotalNumber); + mCapsuleStatusArray = (EFI_STATUS *) AllocateZeroPool(sizeof (EFI_STATUS) * mCapsuleTotalNumber); if (mCapsuleStatusArray == NULL) { DEBUG ((DEBUG_ERROR, "Allocate mCapsuleStatusArray fail!\n")); FreePool(mCapsulePtr); @@ -273,7 +273,7 @@ InitCapsulePtr ( } SetMemN (mCapsuleStatusArray, sizeof (EFI_STATUS) * mCapsuleTotalNumber, EFI_NOT_READY); - CapsuleNameCapsulePtr = (VOID **) AllocateZeroPool (sizeof (VOID *) * CapsuleNameCapsuleTotalNumber); + CapsuleNameCapsulePtr = (VOID **) AllocateZeroPool(sizeof (VOID *) * CapsuleNameCapsuleTotalNumber); if (CapsuleNameCapsulePtr == NULL) { DEBUG ((DEBUG_ERROR, "Allocate CapsuleNameCapsulePtr fail!\n")); FreePool(mCapsulePtr); @@ -310,7 +310,7 @@ InitCapsulePtr ( } if (CapsuleNameTotalNumber == mCapsuleTotalNumber) { - mCapsuleNamePtr = (CHAR16 **) AllocateZeroPool (sizeof (CHAR16 *) * mCapsuleTotalNumber); + mCapsuleNamePtr = (CHAR16 **) AllocateZeroPool(sizeof (CHAR16 *) * mCapsuleTotalNumber); if (mCapsuleNamePtr == NULL) { DEBUG ((DEBUG_ERROR, "Allocate mCapsuleNamePtr fail!\n")); FreePool(mCapsulePtr); @@ -387,12 +387,12 @@ PopulateCapsuleInConfigurationTable ( CacheIndex = 0; CacheNumber = 0; - CapsulePtrCache = (VOID **) AllocateZeroPool (sizeof (VOID *) * mCapsuleTotalNumber); + CapsulePtrCache = (VOID **) AllocateZeroPool(sizeof (VOID *) * mCapsuleTotalNumber); if (CapsulePtrCache == NULL) { DEBUG ((DEBUG_ERROR, "Allocate CapsulePtrCache fail!\n")); return ; } - CapsuleGuidCache = (EFI_GUID *) AllocateZeroPool (sizeof (EFI_GUID) * mCapsuleTotalNumber); + CapsuleGuidCache = (EFI_GUID *) AllocateZeroPool(sizeof (EFI_GUID) * mCapsuleTotalNumber); if (CapsuleGuidCache == NULL) { DEBUG ((DEBUG_ERROR, "Allocate CapsuleGuidCache fail!\n")); FreePool(CapsulePtrCache); diff --git a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleReportLib.c b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleReportLib.c index d5e1d82a6..605e09840 100644 --- a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleReportLib.c +++ b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleReportLib.c @@ -231,7 +231,7 @@ RecordFmpCapsuleStatusVariable ( // CapsuleResultVariableSize = sizeof(EFI_CAPSULE_RESULT_VARIABLE_HEADER) + sizeof(EFI_CAPSULE_RESULT_VARIABLE_FMP) + CapFileNameSize + DevicePathStrSize; - CapsuleResultVariable = AllocateZeroPool (CapsuleResultVariableSize); + CapsuleResultVariable = AllocateZeroPool(CapsuleResultVariableSize); if (CapsuleResultVariable == NULL) { return EFI_OUT_OF_RESOURCES; } diff --git a/MdeModulePkg/Library/DxeCoreMemoryAllocationLib/MemoryAllocationLib.c b/MdeModulePkg/Library/DxeCoreMemoryAllocationLib/MemoryAllocationLib.c index 4b625a3f3..a8404ff34 100644 --- a/MdeModulePkg/Library/DxeCoreMemoryAllocationLib/MemoryAllocationLib.c +++ b/MdeModulePkg/Library/DxeCoreMemoryAllocationLib/MemoryAllocationLib.c @@ -580,7 +580,7 @@ AllocateReservedPool ( **/ VOID * -InternalAllocateZeroPool ( +InternalAllocateZeroPool( IN EFI_MEMORY_TYPE PoolType, IN UINTN AllocationSize ) @@ -609,13 +609,13 @@ InternalAllocateZeroPool ( **/ VOID * EFIAPI -AllocateZeroPool ( +AllocateZeroPool( IN UINTN AllocationSize ) { VOID *Buffer; - Buffer = InternalAllocateZeroPool (EfiBootServicesData, AllocationSize); + Buffer = InternalAllocateZeroPool(EfiBootServicesData, AllocationSize); if (Buffer != NULL) { MemoryProfileLibRecord ( (PHYSICAL_ADDRESS) (UINTN) RETURN_ADDRESS(0), @@ -650,7 +650,7 @@ AllocateRuntimeZeroPool ( { VOID *Buffer; - Buffer = InternalAllocateZeroPool (EfiRuntimeServicesData, AllocationSize); + Buffer = InternalAllocateZeroPool(EfiRuntimeServicesData, AllocationSize); if (Buffer != NULL) { MemoryProfileLibRecord ( (PHYSICAL_ADDRESS) (UINTN) RETURN_ADDRESS(0), @@ -685,7 +685,7 @@ AllocateReservedZeroPool ( { VOID *Buffer; - Buffer = InternalAllocateZeroPool (EfiReservedMemoryType, AllocationSize); + Buffer = InternalAllocateZeroPool(EfiReservedMemoryType, AllocationSize); if (Buffer != NULL) { MemoryProfileLibRecord ( (PHYSICAL_ADDRESS) (UINTN) RETURN_ADDRESS(0), @@ -887,7 +887,7 @@ InternalReallocatePool ( { VOID *NewBuffer; - NewBuffer = InternalAllocateZeroPool (PoolType, NewSize); + NewBuffer = InternalAllocateZeroPool(PoolType, NewSize); if (NewBuffer != NULL && OldBuffer != NULL) { CopyMem (NewBuffer, OldBuffer, MIN (OldSize, NewSize)); FreePool(OldBuffer); diff --git a/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c b/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c index 0bcffcd5f..170955caa 100644 --- a/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c +++ b/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c @@ -754,7 +754,7 @@ CopyStringIntoPerfRecordAndUpdateLength ( DestMax = STRING_SIZE; } } - StringLen = AsciiStrLen (Source); + StringLen = AsciiStrLen(Source); if (StringLen >= DestMax) { StringLen = DestMax -1; } @@ -1109,7 +1109,7 @@ InsertFpdtRecord ( return EFI_INVALID_PARAMETER; } StringPtr = String; - if (AsciiStrLen (String) == 0) { + if (AsciiStrLen(String) == 0) { StringPtr = "unknown name"; } if (!PcdGetBool (PcdEdkiiFpdtStringRecordEnableOnly)) { @@ -1137,7 +1137,7 @@ InsertFpdtRecord ( } else { StringPtr = ModuleName; } - if (AsciiStrLen (StringPtr) == 0) { + if (AsciiStrLen(StringPtr) == 0) { StringPtr = "unknown name"; } if (!PcdGetBool (PcdEdkiiFpdtStringRecordEnableOnly)) { @@ -1159,7 +1159,7 @@ InsertFpdtRecord ( } else { StringPtr = ModuleName; } - if (AsciiStrLen (StringPtr) == 0) { + if (AsciiStrLen(StringPtr) == 0) { StringPtr = "unknown name"; } if (!PcdGetBool (PcdEdkiiFpdtStringRecordEnableOnly)) { @@ -1197,7 +1197,7 @@ InsertFpdtRecord ( } else { CopyMem (&FpdtRecordPtr.DynamicStringEvent->Guid, &ModuleGuid, sizeof (FpdtRecordPtr.DynamicStringEvent->Guid)); } - if (AsciiStrLen (StringPtr) == 0) { + if (AsciiStrLen(StringPtr) == 0) { StringPtr = "unknown name"; } CopyStringIntoPerfRecordAndUpdateLength (FpdtRecordPtr.DynamicStringEvent->String, StringPtr, &FpdtRecordPtr.DynamicStringEvent->Header.Length); @@ -1213,7 +1213,7 @@ InsertFpdtRecord ( } if (PerfId == MODULE_LOADIMAGE_END_ID) { DestMax = CachedFpdtRecordPtr.DynamicStringEvent->Header.Length - sizeof (FPDT_DYNAMIC_STRING_EVENT_RECORD); - StringLen = AsciiStrLen (StringPtr); + StringLen = AsciiStrLen(StringPtr); if (StringLen >= DestMax) { StringLen = DestMax -1; } @@ -1221,7 +1221,7 @@ InsertFpdtRecord ( AsciiStrnCpyS (CachedFpdtRecordPtr.DynamicStringEvent->String, DestMax, StringPtr, StringLen); } else if (PerfId == MODULE_END_ID) { DestMax = FpdtRecordPtr.DynamicStringEvent->Header.Length - sizeof (FPDT_DYNAMIC_STRING_EVENT_RECORD); - StringLen = AsciiStrLen (CachedFpdtRecordPtr.DynamicStringEvent->String); + StringLen = AsciiStrLen(CachedFpdtRecordPtr.DynamicStringEvent->String); if (StringLen >= DestMax) { StringLen = DestMax -1; } diff --git a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c index 900fc1152..61e746e42 100644 --- a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c +++ b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c @@ -380,7 +380,7 @@ HttpParseUrl ( return EFI_INVALID_PARAMETER; } - Parser = AllocateZeroPool (sizeof (HTTP_URL_PARSER)); + Parser = AllocateZeroPool(sizeof (HTTP_URL_PARSER)); if (Parser == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -1081,7 +1081,7 @@ HttpInitMsgParser ( return EFI_INVALID_PARAMETER; } - Parser = AllocateZeroPool (sizeof (HTTP_BODY_PARSER)); + Parser = AllocateZeroPool(sizeof (HTTP_BODY_PARSER)); if (Parser == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -1532,7 +1532,7 @@ HttpSetFieldNameAndValue ( } FieldNameSize = AsciiStrSize (FieldName); - HttpHeader->FieldName = AllocateZeroPool (FieldNameSize); + HttpHeader->FieldName = AllocateZeroPool(FieldNameSize); if (HttpHeader->FieldName == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -1540,7 +1540,7 @@ HttpSetFieldNameAndValue ( HttpHeader->FieldName[FieldNameSize - 1] = 0; FieldValueSize = AsciiStrSize (FieldValue); - HttpHeader->FieldValue = AllocateZeroPool (FieldValueSize); + HttpHeader->FieldValue = AllocateZeroPool(FieldValueSize); if (HttpHeader->FieldValue == NULL) { FreePool(HttpHeader->FieldName); return EFI_OUT_OF_RESOURCES; @@ -1781,7 +1781,7 @@ HttpGenRequestMessage ( // // Build AppendList to send into HttpUtilitiesBuild // - AppendList = AllocateZeroPool (sizeof (EFI_HTTP_HEADER *) * (Message->HeaderCount)); + AppendList = AllocateZeroPool(sizeof (EFI_HTTP_HEADER *) * (Message->HeaderCount)); if (AppendList == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -1823,7 +1823,7 @@ HttpGenRequestMessage ( // If we have a request line, account for the fields. // if (Message->Data.Request != NULL) { - MsgSize += HTTP_METHOD_MAXIMUM_LEN + AsciiStrLen (HTTP_VERSION_CRLF_STR) + AsciiStrLen (Url); + MsgSize += HTTP_METHOD_MAXIMUM_LEN + AsciiStrLen(HTTP_VERSION_CRLF_STR) + AsciiStrLen(Url); } @@ -1836,7 +1836,7 @@ HttpGenRequestMessage ( // memory for the string that needs to be sent to TCP // *RequestMsg = NULL; - *RequestMsg = AllocateZeroPool (MsgSize); + *RequestMsg = AllocateZeroPool(MsgSize); if (*RequestMsg == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Exit; @@ -1888,7 +1888,7 @@ HttpGenRequestMessage ( CopyMem (RequestPtr, EMPTY_SPACE, StrLength); RequestPtr += StrLength; - StrLength = AsciiStrLen (Url); + StrLength = AsciiStrLen(Url); CopyMem (RequestPtr, Url, StrLength); RequestPtr += StrLength; diff --git a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c index c6021fd27..1043d5918 100644 --- a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c +++ b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c @@ -2315,7 +2315,7 @@ NetLibGetMacString ( // Plus one unicode character for the null-terminator. // BufferSize = (2 * HwAddressSize + 5 + 1) * sizeof (CHAR16); - String = AllocateZeroPool (BufferSize); + String = AllocateZeroPool(BufferSize); if (String == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -3370,7 +3370,7 @@ NetLibCreateDnsQName ( return NULL; } - QueryName = AllocateZeroPool (QueryNameSize); + QueryName = AllocateZeroPool(QueryNameSize); if (QueryName == NULL) { return NULL; } diff --git a/MdeModulePkg/Library/DxeNetLib/NetBuffer.c b/MdeModulePkg/Library/DxeNetLib/NetBuffer.c index fe7e3979a..efd5888c1 100644 --- a/MdeModulePkg/Library/DxeNetLib/NetBuffer.c +++ b/MdeModulePkg/Library/DxeNetLib/NetBuffer.c @@ -49,7 +49,7 @@ NetbufAllocStruct ( // // Allocate three memory blocks. // - Nbuf = AllocateZeroPool (NET_BUF_SIZE (BlockOpNum)); + Nbuf = AllocateZeroPool(NET_BUF_SIZE (BlockOpNum)); if (Nbuf == NULL) { return NULL; @@ -61,7 +61,7 @@ NetbufAllocStruct ( InitializeListHead (&Nbuf->List); if (BlockNum != 0) { - Vector = AllocateZeroPool (NET_VECTOR_SIZE (BlockNum)); + Vector = AllocateZeroPool(NET_VECTOR_SIZE (BlockNum)); if (Vector == NULL) { goto FreeNbuf; diff --git a/MdeModulePkg/Library/DxeReportStatusCodeLib/ReportStatusCodeLib.c b/MdeModulePkg/Library/DxeReportStatusCodeLib/ReportStatusCodeLib.c index 0031446d8..d3db562e7 100644 --- a/MdeModulePkg/Library/DxeReportStatusCodeLib/ReportStatusCodeLib.c +++ b/MdeModulePkg/Library/DxeReportStatusCodeLib/ReportStatusCodeLib.c @@ -211,7 +211,7 @@ ReportStatusCodeExtractAssertInfo ( ((Value & EFI_STATUS_CODE_OPERATION_MASK) == EFI_SW_EC_ILLEGAL_SOFTWARE_STATE)) { AssertData = (EFI_DEBUG_ASSERT_DATA *)(Data + 1); *Filename = (CHAR8 *)(AssertData + 1); - *Description = *Filename + AsciiStrLen (*Filename) + 1; + *Description = *Filename + AsciiStrLen(*Filename) + 1; *LineNumber = AssertData->LineNumber; return TRUE; } diff --git a/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c b/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c index fdb6e4680..e3d35b885 100644 --- a/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c +++ b/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c @@ -301,12 +301,12 @@ LibCreateMenuEntry ( // // Create new menu entry // - MenuEntry = AllocateZeroPool (sizeof (MENU_ENTRY)); + MenuEntry = AllocateZeroPool(sizeof (MENU_ENTRY)); if (MenuEntry == NULL) { return NULL; } - MenuEntry->VariableContext = AllocateZeroPool (sizeof (FILE_CONTEXT)); + MenuEntry->VariableContext = AllocateZeroPool(sizeof (FILE_CONTEXT)); if (MenuEntry->VariableContext == NULL) { FreePool(MenuEntry); return NULL; @@ -516,7 +516,7 @@ LibStrDuplicate ( UINTN Size; Size = StrSize (Src); - Dest = AllocateZeroPool (Size); + Dest = AllocateZeroPool(Size); ASSERT (Dest != NULL); if (Dest != NULL) { CopyMem (Dest, Src, Size); @@ -694,10 +694,10 @@ LibAppendFileName ( } MaxLen = (Size1 + Size2 + sizeof (CHAR16))/ sizeof (CHAR16); - Str = AllocateZeroPool (Size1 + Size2 + sizeof (CHAR16)); + Str = AllocateZeroPool(Size1 + Size2 + sizeof (CHAR16)); ASSERT (Str != NULL); - TmpStr = AllocateZeroPool (Size1 + Size2 + sizeof (CHAR16)); + TmpStr = AllocateZeroPool(Size1 + Size2 + sizeof (CHAR16)); ASSERT (TmpStr != NULL); StrCpyS (Str, MaxLen, Str1); @@ -830,7 +830,7 @@ LibFindFileSystem ( } } } - MenuEntry->DisplayString = AllocateZeroPool (MAX_CHAR); + MenuEntry->DisplayString = AllocateZeroPool(MAX_CHAR); ASSERT (MenuEntry->DisplayString != NULL); UnicodeSPrint ( MenuEntry->DisplayString, @@ -1148,7 +1148,7 @@ LibFindFiles ( OptionNumber = 0; DirBufferSize = sizeof (EFI_FILE_INFO) + 1024; - DirInfo = AllocateZeroPool (DirBufferSize); + DirInfo = AllocateZeroPool(DirBufferSize); if (DirInfo == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -1207,7 +1207,7 @@ LibFindFiles ( if (NewFileContext->IsDir) { BufferSize = StrLen (DirInfo->FileName) * 2 + 6; - NewMenuEntry->DisplayString = AllocateZeroPool (BufferSize); + NewMenuEntry->DisplayString = AllocateZeroPool(BufferSize); UnicodeSPrint ( NewMenuEntry->DisplayString, BufferSize, diff --git a/MdeModulePkg/Library/NonDiscoverableDeviceRegistrationLib/NonDiscoverableDeviceRegistrationLib.c b/MdeModulePkg/Library/NonDiscoverableDeviceRegistrationLib/NonDiscoverableDeviceRegistrationLib.c index b80c4a540..37575be49 100644 --- a/MdeModulePkg/Library/NonDiscoverableDeviceRegistrationLib/NonDiscoverableDeviceRegistrationLib.c +++ b/MdeModulePkg/Library/NonDiscoverableDeviceRegistrationLib/NonDiscoverableDeviceRegistrationLib.c @@ -133,7 +133,7 @@ RegisterNonDiscoverableMmioDevice ( AllocSize = sizeof *Device + NumMmioResources * sizeof (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR) + sizeof (EFI_ACPI_END_TAG_DESCRIPTOR); - Device = (NON_DISCOVERABLE_DEVICE *)AllocateZeroPool (AllocSize); + Device = (NON_DISCOVERABLE_DEVICE *)AllocateZeroPool(AllocSize); if (Device == NULL) { return EFI_OUT_OF_RESOURCES; } diff --git a/MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.c b/MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.c index da0bc1d80..6f92e8ff1 100644 --- a/MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.c +++ b/MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.c @@ -267,7 +267,7 @@ CopyStringIntoPerfRecordAndUpdateLength ( DestMax = STRING_SIZE; } } - StringLen = AsciiStrLen (Source); + StringLen = AsciiStrLen(Source); if (StringLen >= DestMax) { StringLen = DestMax -1; } @@ -421,7 +421,7 @@ InsertFpdtRecord ( return EFI_INVALID_PARAMETER; } StringPtr = String; - if (AsciiStrLen (String) == 0) { + if (AsciiStrLen(String) == 0) { StringPtr = "unknown name"; } if (!PcdGetBool (PcdEdkiiFpdtStringRecordEnableOnly)) { @@ -443,7 +443,7 @@ InsertFpdtRecord ( case PERF_INMODULE_END_ID: case PERF_CROSSMODULE_START_ID: case PERF_CROSSMODULE_END_ID: - if (String != NULL && AsciiStrLen (String) != 0) { + if (String != NULL && AsciiStrLen(String) != 0) { StringPtr = String; } else { StringPtr = "unknown name"; @@ -461,7 +461,7 @@ InsertFpdtRecord ( default: if (Attribute != PerfEntry) { - if (String != NULL && AsciiStrLen (String) != 0) { + if (String != NULL && AsciiStrLen(String) != 0) { StringPtr = String; } else { StringPtr = "unknown name"; diff --git a/MdeModulePkg/Library/PeiReportStatusCodeLib/ReportStatusCodeLib.c b/MdeModulePkg/Library/PeiReportStatusCodeLib/ReportStatusCodeLib.c index a32d4762f..1ed321a8f 100644 --- a/MdeModulePkg/Library/PeiReportStatusCodeLib/ReportStatusCodeLib.c +++ b/MdeModulePkg/Library/PeiReportStatusCodeLib/ReportStatusCodeLib.c @@ -183,7 +183,7 @@ ReportStatusCodeExtractAssertInfo ( ((Value & EFI_STATUS_CODE_OPERATION_MASK) == EFI_SW_EC_ILLEGAL_SOFTWARE_STATE)) { AssertData = (EFI_DEBUG_ASSERT_DATA *)(Data + 1); *Filename = (CHAR8 *)(AssertData + 1); - *Description = *Filename + AsciiStrLen (*Filename) + 1; + *Description = *Filename + AsciiStrLen(*Filename) + 1; *LineNumber = AssertData->LineNumber; return TRUE; } diff --git a/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c b/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c index e091d96f1..304fbf8b3 100644 --- a/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c +++ b/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c @@ -1761,7 +1761,7 @@ S3BootScriptSaveInformationAsciiString ( ) { return S3BootScriptSaveInformation ( - (UINT32) AsciiStrLen (String) + 1, + (UINT32) AsciiStrLen(String) + 1, (VOID*) String ); } diff --git a/MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/MemoryAllocationLib.c b/MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/MemoryAllocationLib.c index 43d674be2..27491219c 100644 --- a/MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/MemoryAllocationLib.c +++ b/MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/MemoryAllocationLib.c @@ -597,7 +597,7 @@ AllocateReservedPool ( **/ VOID * -InternalAllocateZeroPool ( +InternalAllocateZeroPool( IN EFI_MEMORY_TYPE PoolType, IN UINTN AllocationSize ) @@ -626,13 +626,13 @@ InternalAllocateZeroPool ( **/ VOID * EFIAPI -AllocateZeroPool ( +AllocateZeroPool( IN UINTN AllocationSize ) { VOID *Buffer; - Buffer = InternalAllocateZeroPool (EfiRuntimeServicesData, AllocationSize); + Buffer = InternalAllocateZeroPool(EfiRuntimeServicesData, AllocationSize); if (Buffer != NULL) { MemoryProfileLibRecord ( (PHYSICAL_ADDRESS) (UINTN) RETURN_ADDRESS(0), @@ -667,7 +667,7 @@ AllocateRuntimeZeroPool ( { VOID *Buffer; - Buffer = InternalAllocateZeroPool (EfiRuntimeServicesData, AllocationSize); + Buffer = InternalAllocateZeroPool(EfiRuntimeServicesData, AllocationSize); if (Buffer != NULL) { MemoryProfileLibRecord ( (PHYSICAL_ADDRESS) (UINTN) RETURN_ADDRESS(0), @@ -878,7 +878,7 @@ InternalReallocatePool ( { VOID *NewBuffer; - NewBuffer = InternalAllocateZeroPool (PoolType, NewSize); + NewBuffer = InternalAllocateZeroPool(PoolType, NewSize); if (NewBuffer != NULL && OldBuffer != NULL) { CopyMem (NewBuffer, OldBuffer, MIN (OldSize, NewSize)); FreePool(OldBuffer); diff --git a/MdeModulePkg/Library/PlatformVarCleanupLib/PlatVarCleanupLib.c b/MdeModulePkg/Library/PlatformVarCleanupLib/PlatVarCleanupLib.c index 3a0fe169d..9ea2de375 100644 --- a/MdeModulePkg/Library/PlatformVarCleanupLib/PlatVarCleanupLib.c +++ b/MdeModulePkg/Library/PlatformVarCleanupLib/PlatVarCleanupLib.c @@ -161,7 +161,7 @@ FindUserVariableNodeByGuid ( // // Create new one if not found. // - UserVariableNode = AllocateZeroPool (sizeof (*UserVariableNode)); + UserVariableNode = AllocateZeroPool(sizeof (*UserVariableNode)); ASSERT (UserVariableNode != NULL); UserVariableNode->Signature = USER_VARIABLE_NODE_SIGNATURE; CopyGuid (&UserVariableNode->Guid, Guid); @@ -204,14 +204,14 @@ CreateUserVariableNode ( // Initialize 128 * sizeof (CHAR16) variable name size. // MaxVarNameSize = 128 * sizeof (CHAR16); - VarName = AllocateZeroPool (MaxVarNameSize); + VarName = AllocateZeroPool(MaxVarNameSize); ASSERT (VarName != NULL); // // Initialize 0x1000 variable data size. // MaxDataSize = 0x1000; - Data = AllocateZeroPool (MaxDataSize); + Data = AllocateZeroPool(MaxDataSize); ASSERT (Data != NULL); Index = 0; @@ -244,7 +244,7 @@ CreateUserVariableNode ( // // Different variables that have same variable GUID share same user variable node. // - UserVariableNameNode = AllocateZeroPool (sizeof (*UserVariableNameNode)); + UserVariableNameNode = AllocateZeroPool(sizeof (*UserVariableNameNode)); ASSERT (UserVariableNameNode != NULL); UserVariableNameNode->Signature = USER_VARIABLE_NAME_NODE_SIGNATURE; UserVariableNameNode->Name = AllocateCopyPool(VarNameSize, VarName); @@ -365,7 +365,7 @@ CreateTimeBasedPayload ( PayloadSize = *DataSize; DescriptorSize = OFFSET_OF (EFI_VARIABLE_AUTHENTICATION_2, AuthInfo) + OFFSET_OF (WIN_CERTIFICATE_UEFI_GUID, CertData); - NewData = (UINT8 *) AllocateZeroPool (DescriptorSize + PayloadSize); + NewData = (UINT8 *) AllocateZeroPool(DescriptorSize + PayloadSize); if (NewData == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -451,7 +451,7 @@ CreateCounterBasedPayload ( DescriptorSize = (OFFSET_OF (EFI_VARIABLE_AUTHENTICATION, AuthInfo)) + \ (OFFSET_OF (WIN_CERTIFICATE_UEFI_GUID, CertData)) + \ sizeof (EFI_CERT_BLOCK_RSA_2048_SHA256); - NewData = (UINT8 *) AllocateZeroPool (DescriptorSize + PayloadSize); + NewData = (UINT8 *) AllocateZeroPool(DescriptorSize + PayloadSize); if (NewData == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -611,7 +611,7 @@ VariableCleanupHiiExtractConfig ( // ConfigRequestHdr = HiiConstructConfigHdr (&mVariableCleanupHiiGuid, mVarStoreName, Private->HiiHandle); Size = (StrLen (ConfigRequestHdr) + 32 + 1) * sizeof (CHAR16); - ConfigRequest = AllocateZeroPool (Size); + ConfigRequest = AllocateZeroPool(Size); ASSERT (ConfigRequest != NULL); AllocatedRequest = TRUE; UnicodeSPrint (ConfigRequest, Size, L"%s&OFFSET=0&WIDTH=%016LX", ConfigRequestHdr, (UINT64)BufferSize); @@ -1081,7 +1081,7 @@ PlatformVarCleanup ( return Status; } - Private = AllocateZeroPool (sizeof (VARIABLE_CLEANUP_HII_PRIVATE_DATA)); + Private = AllocateZeroPool(sizeof (VARIABLE_CLEANUP_HII_PRIVATE_DATA)); if (Private == NULL) { return EFI_OUT_OF_RESOURCES; } diff --git a/MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/ReportStatusCodeLib.c b/MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/ReportStatusCodeLib.c index c533db416..dc0349761 100644 --- a/MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/ReportStatusCodeLib.c +++ b/MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/ReportStatusCodeLib.c @@ -348,7 +348,7 @@ ReportStatusCodeExtractAssertInfo ( ((Value & EFI_STATUS_CODE_OPERATION_MASK) == EFI_SW_EC_ILLEGAL_SOFTWARE_STATE)) { AssertData = (EFI_DEBUG_ASSERT_DATA *)(Data + 1); *Filename = (CHAR8 *)(AssertData + 1); - *Description = *Filename + AsciiStrLen (*Filename) + 1; + *Description = *Filename + AsciiStrLen(*Filename) + 1; *LineNumber = AssertData->LineNumber; return TRUE; } diff --git a/MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformanceLib.c b/MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformanceLib.c index a0c3c8fab..9c87056eb 100644 --- a/MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformanceLib.c +++ b/MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformanceLib.c @@ -465,7 +465,7 @@ CopyStringIntoPerfRecordAndUpdateLength ( DestMax = STRING_SIZE; } } - StringLen = AsciiStrLen (Source); + StringLen = AsciiStrLen(Source); if (StringLen >= DestMax) { StringLen = DestMax -1; } @@ -647,7 +647,7 @@ InsertFpdtRecord ( return EFI_INVALID_PARAMETER; } StringPtr = String; - if (AsciiStrLen (String) == 0) { + if (AsciiStrLen(String) == 0) { StringPtr = "unknown name"; } if (!PcdGetBool (PcdEdkiiFpdtStringRecordEnableOnly)) { @@ -675,7 +675,7 @@ InsertFpdtRecord ( } else { StringPtr = ModuleName; } - if (AsciiStrLen (StringPtr) == 0) { + if (AsciiStrLen(StringPtr) == 0) { StringPtr = "unknown name"; } if (!PcdGetBool (PcdEdkiiFpdtStringRecordEnableOnly)) { @@ -697,7 +697,7 @@ InsertFpdtRecord ( } else { StringPtr = ModuleName; } - if (AsciiStrLen (StringPtr) == 0) { + if (AsciiStrLen(StringPtr) == 0) { StringPtr = "unknown name"; } if (!PcdGetBool (PcdEdkiiFpdtStringRecordEnableOnly)) { @@ -735,7 +735,7 @@ InsertFpdtRecord ( } else { CopyMem (&FpdtRecordPtr.DynamicStringEvent->Guid, &ModuleGuid, sizeof (FpdtRecordPtr.DynamicStringEvent->Guid)); } - if (AsciiStrLen (StringPtr) == 0) { + if (AsciiStrLen(StringPtr) == 0) { StringPtr = "unknown name"; } CopyStringIntoPerfRecordAndUpdateLength (FpdtRecordPtr.DynamicStringEvent->String, StringPtr, &FpdtRecordPtr.DynamicStringEvent->Header.Length); @@ -747,7 +747,7 @@ InsertFpdtRecord ( CachedFpdtRecordPtr.RecordHeader = (EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER *)((UINT8*)mSmmBootPerformanceTable + mCachedLength); if (PerfId == MODULE_LOADIMAGE_END_ID) { DestMax = CachedFpdtRecordPtr.DynamicStringEvent->Header.Length - sizeof (FPDT_DYNAMIC_STRING_EVENT_RECORD); - StringLen = AsciiStrLen (StringPtr); + StringLen = AsciiStrLen(StringPtr); if (StringLen >= DestMax) { StringLen = DestMax -1; } @@ -755,7 +755,7 @@ InsertFpdtRecord ( AsciiStrnCpyS (CachedFpdtRecordPtr.DynamicStringEvent->String, DestMax, StringPtr, StringLen); } else if (PerfId == MODULE_END_ID) { DestMax = FpdtRecordPtr.DynamicStringEvent->Header.Length - sizeof (FPDT_DYNAMIC_STRING_EVENT_RECORD); - StringLen = AsciiStrLen (CachedFpdtRecordPtr.DynamicStringEvent->String); + StringLen = AsciiStrLen(CachedFpdtRecordPtr.DynamicStringEvent->String); if (StringLen >= DestMax) { StringLen = DestMax -1; } diff --git a/MdeModulePkg/Library/SmmMemoryAllocationProfileLib/MemoryAllocationLib.c b/MdeModulePkg/Library/SmmMemoryAllocationProfileLib/MemoryAllocationLib.c index 0f3e82aaa..72b9c3207 100644 --- a/MdeModulePkg/Library/SmmMemoryAllocationProfileLib/MemoryAllocationLib.c +++ b/MdeModulePkg/Library/SmmMemoryAllocationProfileLib/MemoryAllocationLib.c @@ -680,7 +680,7 @@ AllocateReservedPool ( **/ VOID * -InternalAllocateZeroPool ( +InternalAllocateZeroPool( IN EFI_MEMORY_TYPE PoolType, IN UINTN AllocationSize ) @@ -709,13 +709,13 @@ InternalAllocateZeroPool ( **/ VOID * EFIAPI -AllocateZeroPool ( +AllocateZeroPool( IN UINTN AllocationSize ) { VOID *Buffer; - Buffer = InternalAllocateZeroPool (EfiRuntimeServicesData, AllocationSize); + Buffer = InternalAllocateZeroPool(EfiRuntimeServicesData, AllocationSize); if (Buffer != NULL) { MemoryProfileLibRecord ( (PHYSICAL_ADDRESS) (UINTN) RETURN_ADDRESS(0), @@ -750,7 +750,7 @@ AllocateRuntimeZeroPool ( { VOID *Buffer; - Buffer = InternalAllocateZeroPool (EfiRuntimeServicesData, AllocationSize); + Buffer = InternalAllocateZeroPool(EfiRuntimeServicesData, AllocationSize); if (Buffer != NULL) { MemoryProfileLibRecord ( (PHYSICAL_ADDRESS) (UINTN) RETURN_ADDRESS(0), @@ -964,7 +964,7 @@ InternalReallocatePool ( { VOID *NewBuffer; - NewBuffer = InternalAllocateZeroPool (PoolType, NewSize); + NewBuffer = InternalAllocateZeroPool(PoolType, NewSize); if (NewBuffer != NULL && OldBuffer != NULL) { CopyMem (NewBuffer, OldBuffer, MIN (OldSize, NewSize)); FreePool(OldBuffer); diff --git a/MdeModulePkg/Library/SmmReportStatusCodeLib/ReportStatusCodeLib.c b/MdeModulePkg/Library/SmmReportStatusCodeLib/ReportStatusCodeLib.c index acfc6b40d..9d2cb053c 100644 --- a/MdeModulePkg/Library/SmmReportStatusCodeLib/ReportStatusCodeLib.c +++ b/MdeModulePkg/Library/SmmReportStatusCodeLib/ReportStatusCodeLib.c @@ -200,7 +200,7 @@ ReportStatusCodeExtractAssertInfo ( ((Value & EFI_STATUS_CODE_OPERATION_MASK) == EFI_SW_EC_ILLEGAL_SOFTWARE_STATE)) { AssertData = (EFI_DEBUG_ASSERT_DATA *)(Data + 1); *Filename = (CHAR8 *)(AssertData + 1); - *Description = *Filename + AsciiStrLen (*Filename) + 1; + *Description = *Filename + AsciiStrLen(*Filename) + 1; *LineNumber = AssertData->LineNumber; return TRUE; } diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBootDescription.c b/MdeModulePkg/Library/UefiBootManagerLib/BmBootDescription.c index d8a912040..d23beb3b5 100644 --- a/MdeModulePkg/Library/UefiBootManagerLib/BmBootDescription.c +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBootDescription.c @@ -171,7 +171,7 @@ BmGetDescriptionFromDiskInfo ( &BufferSize ); if (!EFI_ERROR(Status)) { - Description = AllocateZeroPool ((ModelNameLength + SerialNumberLength + 2) * sizeof (CHAR16)); + Description = AllocateZeroPool((ModelNameLength + SerialNumberLength + 2) * sizeof (CHAR16)); ASSERT (Description != NULL); for (Index = 0; Index + 1 < ModelNameLength; Index += 2) { Description[Index] = (CHAR16) IdentifyData.ModelName[Index + 1]; @@ -199,7 +199,7 @@ BmGetDescriptionFromDiskInfo ( &BufferSize ); if (!EFI_ERROR(Status)) { - Description = AllocateZeroPool ((VENDOR_IDENTIFICATION_LENGTH + PRODUCT_IDENTIFICATION_LENGTH + 2) * sizeof (CHAR16)); + Description = AllocateZeroPool((VENDOR_IDENTIFICATION_LENGTH + PRODUCT_IDENTIFICATION_LENGTH + 2) * sizeof (CHAR16)); ASSERT (Description != NULL); // @@ -327,7 +327,7 @@ BmGetUsbDescription ( } DescMaxSize = StrSize (Manufacturer) + StrSize (Product) + StrSize (SerialNumber); - Description = AllocateZeroPool (DescMaxSize); + Description = AllocateZeroPool(DescMaxSize); ASSERT (Description != NULL); StrCatS (Description, DescMaxSize/sizeof(CHAR16), Manufacturer); StrCatS (Description, DescMaxSize/sizeof(CHAR16), L" "); @@ -620,7 +620,7 @@ BmGetNvmeDescription ( return NULL; } - Description = AllocateZeroPool ( + Description = AllocateZeroPool( (ARRAY_SIZE (ControllerData.Mn) + 1 + ARRAY_SIZE (ControllerData.Sn) + 1 + MAXIMUM_VALUE_CHARACTERS + 1 @@ -847,7 +847,7 @@ BmMakeBootOptionDescriptionUnique ( MaxSuffixSize += sizeof (CHAR16); } - Visited = AllocateZeroPool (sizeof (BOOLEAN) * BootOptionCount); + Visited = AllocateZeroPool(sizeof (BOOLEAN) * BootOptionCount); ASSERT (Visited != NULL); for (Base = 0; Base < BootOptionCount; Base++) { diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmHotkey.c b/MdeModulePkg/Library/UefiBootManagerLib/BmHotkey.c index 710618dc2..a44cadaee 100644 --- a/MdeModulePkg/Library/UefiBootManagerLib/BmHotkey.c +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmHotkey.c @@ -666,7 +666,7 @@ BmProcessKeyOption ( Handles = BmGetActiveConsoleIn (&HandleCount); for (Index = 0; Index < KeyShiftStateCount; Index++) { - Hotkey = AllocateZeroPool (sizeof (BM_HOTKEY)); + Hotkey = AllocateZeroPool(sizeof (BM_HOTKEY)); ASSERT (Hotkey != NULL); Hotkey->Signature = BM_HOTKEY_SIGNATURE; diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c b/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c index 860598d74..68d2aac02 100644 --- a/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c @@ -44,7 +44,7 @@ BmForEachVariable ( UINTN NewNameSize; NameSize = sizeof (CHAR16); - Name = AllocateZeroPool (NameSize); + Name = AllocateZeroPool(NameSize); ASSERT (Name != NULL); while (TRUE) { NewNameSize = NameSize; diff --git a/MdeModulePkg/Library/UefiHiiLib/HiiLanguage.c b/MdeModulePkg/Library/UefiHiiLib/HiiLanguage.c index 369c75880..c089bf823 100644 --- a/MdeModulePkg/Library/UefiHiiLib/HiiLanguage.c +++ b/MdeModulePkg/Library/UefiHiiLib/HiiLanguage.c @@ -62,7 +62,7 @@ HiiGetSupportedLanguages ( // // Allocate the supported languages buffer. // - SupportedLanguages = AllocateZeroPool (LanguageSize); + SupportedLanguages = AllocateZeroPool(LanguageSize); if (SupportedLanguages == NULL) { // // Return NULL if allocation fails. diff --git a/MdeModulePkg/Library/UefiHiiLib/HiiLib.c b/MdeModulePkg/Library/UefiHiiLib/HiiLib.c index 27e60f886..7908c0a70 100644 --- a/MdeModulePkg/Library/UefiHiiLib/HiiLib.c +++ b/MdeModulePkg/Library/UefiHiiLib/HiiLib.c @@ -180,7 +180,7 @@ HiiAddPackages ( // // Allocate the storage for the entire Package List // - PackageListHeader = AllocateZeroPool (Length); + PackageListHeader = AllocateZeroPool(Length); // // If the Package List can not be allocated, then return a NULL HII Handle @@ -328,7 +328,7 @@ HiiGetHiiHandles ( // // Allocate the array of HII handles to hold all the HII Handles and a NULL terminator // - HiiHandleBuffer = AllocateZeroPool (HandleBufferLength + sizeof (EFI_HII_HANDLE)); + HiiHandleBuffer = AllocateZeroPool(HandleBufferLength + sizeof (EFI_HII_HANDLE)); if (HiiHandleBuffer == NULL) { // // Return NULL if allocation fails. @@ -653,7 +653,7 @@ InternalHiiBrowserCallback ( // // No Resluts Data, only allocate one char for '\0' // - ResultsData = AllocateZeroPool (sizeof (CHAR16)); + ResultsData = AllocateZeroPool(sizeof (CHAR16)); return ResultsData; } @@ -664,7 +664,7 @@ InternalHiiBrowserCallback ( // // Allocate the ResultsData buffer // - ResultsData = AllocateZeroPool (ResultsDataSize); + ResultsData = AllocateZeroPool(ResultsDataSize); if (ResultsData == NULL) { return NULL; } @@ -763,7 +763,7 @@ HiiConstructConfigHdr ( // | 5 | sizeof (EFI_GUID) * 2 | 6 | NameStrLen*4 | 6 | DevicePathSize * 2 | 1 | // MaxLen = 5 + sizeof (EFI_GUID) * 2 + 6 + NameLength * 4 + 6 + DevicePathSize * 2 + 1; - String = AllocateZeroPool (MaxLen * sizeof (CHAR16)); + String = AllocateZeroPool(MaxLen * sizeof (CHAR16)); if (String == NULL) { return NULL; } @@ -896,7 +896,7 @@ InternalHiiGetBufferFromString ( // as the device path and Guid resides in RAM memory. // Translate the data into binary. // - DataBuffer = (UINT8 *) AllocateZeroPool ((Length + 1) / 2); + DataBuffer = (UINT8 *) AllocateZeroPool((Length + 1) / 2); if (DataBuffer == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -925,7 +925,7 @@ InternalHiiGetBufferFromString ( // // Add the tailling char L'\0' // - DataBuffer = (UINT8 *) AllocateZeroPool ((Length/4 + 1) * sizeof (CHAR16)); + DataBuffer = (UINT8 *) AllocateZeroPool((Length/4 + 1) * sizeof (CHAR16)); if (DataBuffer == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -1040,7 +1040,7 @@ InternalHiiGetValueOfNumber ( // // Allocate buffer to store the value // - Buf = (UINT8 *) AllocateZeroPool ((Length + 1) / 2); + Buf = (UINT8 *) AllocateZeroPool((Length + 1) / 2); if (Buf == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -1890,7 +1890,7 @@ GetBlockDataInfo ( TmpBuffer = NULL; BlockArray = NULL; MaxBufferSize = HII_LIB_DEFAULT_VARSTORE_SIZE; - DataBuffer = AllocateZeroPool (MaxBufferSize); + DataBuffer = AllocateZeroPool(MaxBufferSize); if (DataBuffer == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -1898,7 +1898,7 @@ GetBlockDataInfo ( // // Init BlockArray // - BlockArray = (IFR_BLOCK_DATA *) AllocateZeroPool (sizeof (IFR_BLOCK_DATA)); + BlockArray = (IFR_BLOCK_DATA *) AllocateZeroPool(sizeof (IFR_BLOCK_DATA)); if (BlockArray == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Done; @@ -2010,7 +2010,7 @@ GetBlockDataInfo ( // // Set new Block Data // - NewBlockData = (IFR_BLOCK_DATA *) AllocateZeroPool (sizeof (IFR_BLOCK_DATA)); + NewBlockData = (IFR_BLOCK_DATA *) AllocateZeroPool(sizeof (IFR_BLOCK_DATA)); if (NewBlockData == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Done; @@ -2527,7 +2527,7 @@ NextConfigAltResp: // | 1 | StrLen (ConfigHdr) | 8 | 1 | // MaxLen = 1 + StringPtr - StringHdr + 8 + 1; - ConfigAltHdr = AllocateZeroPool ( MaxLen * sizeof (CHAR16)); + ConfigAltHdr = AllocateZeroPool( MaxLen * sizeof (CHAR16)); if (ConfigAltHdr == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Done; @@ -2825,7 +2825,7 @@ HiiGetBrowserData ( // Size = (StrLen (mConfigHdrTemplate) + 1) * sizeof (CHAR16); Size = Size + (StrLen (ResultsData) + 1) * sizeof (CHAR16); - ConfigResp = AllocateZeroPool (Size); + ConfigResp = AllocateZeroPool(Size); UnicodeSPrint (ConfigResp, Size, L"%s&%s", mConfigHdrTemplate, ResultsData); // @@ -2905,7 +2905,7 @@ HiiSetBrowserData ( // followed by "&OFFSET=0&WIDTH=WWWWWWWWWWWWWWWW" followed by a Null-terminator // Size = (StrLen (mConfigHdrTemplate) + 32 + 1) * sizeof (CHAR16); - ConfigRequest = AllocateZeroPool (Size); + ConfigRequest = AllocateZeroPool(Size); UnicodeSPrint (ConfigRequest, Size, L"%s&OFFSET=0&WIDTH=%016LX", mConfigHdrTemplate, (UINT64)BufferSize); } else { // @@ -2914,7 +2914,7 @@ HiiSetBrowserData ( // Size = StrLen (mConfigHdrTemplate) * sizeof (CHAR16); Size = Size + (StrLen (RequestElement) + 1) * sizeof (CHAR16); - ConfigRequest = AllocateZeroPool (Size); + ConfigRequest = AllocateZeroPool(Size); UnicodeSPrint (ConfigRequest, Size, L"%s%s", mConfigHdrTemplate, RequestElement); } if (ConfigRequest == NULL) { @@ -4390,7 +4390,7 @@ HiiUpdateForm ( // Calculate and allocate space for retrieval of IFR data // BufferSize += OpCodeBufferStart->Position; - UpdatePackageList = AllocateZeroPool (BufferSize); + UpdatePackageList = AllocateZeroPool(BufferSize); if (UpdatePackageList == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Finish; @@ -4399,7 +4399,7 @@ HiiUpdateForm ( // // Allocate temp buffer to store the temp updated package buffer // - TempPackage = AllocateZeroPool (BufferSize); + TempPackage = AllocateZeroPool(BufferSize); if (TempPackage == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Finish; diff --git a/MdeModulePkg/Library/UefiHiiLib/HiiString.c b/MdeModulePkg/Library/UefiHiiLib/HiiString.c index 74fe6df1e..0333b7cb6 100644 --- a/MdeModulePkg/Library/UefiHiiLib/HiiString.c +++ b/MdeModulePkg/Library/UefiHiiLib/HiiString.c @@ -101,7 +101,7 @@ HiiSetString ( *(Supported++) = '\0'; } - if ((SupportedLanguages == NULL) && AsciiStrnCmp (Language, UEFI_CONFIG_LANG, AsciiStrLen (UEFI_CONFIG_LANG)) == 0) { + if ((SupportedLanguages == NULL) && AsciiStrnCmp (Language, UEFI_CONFIG_LANG, AsciiStrLen(UEFI_CONFIG_LANG)) == 0) { // // Skip string package used for keyword protocol. // @@ -302,7 +302,7 @@ HiiGetString ( // // Allocate a buffer for the return string // - String = AllocateZeroPool (StringSize); + String = AllocateZeroPool(StringSize); if (String == NULL) { goto Error; } diff --git a/MdeModulePkg/Library/UefiMemoryAllocationProfileLib/MemoryAllocationLib.c b/MdeModulePkg/Library/UefiMemoryAllocationProfileLib/MemoryAllocationLib.c index d10ee8555..662154403 100644 --- a/MdeModulePkg/Library/UefiMemoryAllocationProfileLib/MemoryAllocationLib.c +++ b/MdeModulePkg/Library/UefiMemoryAllocationProfileLib/MemoryAllocationLib.c @@ -573,7 +573,7 @@ AllocateReservedPool ( **/ VOID * -InternalAllocateZeroPool ( +InternalAllocateZeroPool( IN EFI_MEMORY_TYPE PoolType, IN UINTN AllocationSize ) @@ -602,13 +602,13 @@ InternalAllocateZeroPool ( **/ VOID * EFIAPI -AllocateZeroPool ( +AllocateZeroPool( IN UINTN AllocationSize ) { VOID *Buffer; - Buffer = InternalAllocateZeroPool (EfiBootServicesData, AllocationSize); + Buffer = InternalAllocateZeroPool(EfiBootServicesData, AllocationSize); if (Buffer != NULL) { MemoryProfileLibRecord ( (PHYSICAL_ADDRESS) (UINTN) RETURN_ADDRESS(0), @@ -643,7 +643,7 @@ AllocateRuntimeZeroPool ( { VOID *Buffer; - Buffer = InternalAllocateZeroPool (EfiRuntimeServicesData, AllocationSize); + Buffer = InternalAllocateZeroPool(EfiRuntimeServicesData, AllocationSize); if (Buffer != NULL) { MemoryProfileLibRecord ( (PHYSICAL_ADDRESS) (UINTN) RETURN_ADDRESS(0), @@ -678,7 +678,7 @@ AllocateReservedZeroPool ( { VOID *Buffer; - Buffer = InternalAllocateZeroPool (EfiReservedMemoryType, AllocationSize); + Buffer = InternalAllocateZeroPool(EfiReservedMemoryType, AllocationSize); if (Buffer != NULL) { MemoryProfileLibRecord ( (PHYSICAL_ADDRESS) (UINTN) RETURN_ADDRESS(0), @@ -880,7 +880,7 @@ InternalReallocatePool ( { VOID *NewBuffer; - NewBuffer = InternalAllocateZeroPool (PoolType, NewSize); + NewBuffer = InternalAllocateZeroPool(PoolType, NewSize); if (NewBuffer != NULL && OldBuffer != NULL) { CopyMem (NewBuffer, OldBuffer, MIN (OldSize, NewSize)); FreePool(OldBuffer); diff --git a/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGen.c b/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGen.c index e0708b4c8..c4abc7a21 100644 --- a/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGen.c +++ b/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGen.c @@ -404,7 +404,7 @@ InternalVarCheckAllocatePool ( **/ VOID * -InternalVarCheckAllocateZeroPool ( +InternalVarCheckAllocateZeroPool( IN UINTN AllocationSize ) { @@ -473,7 +473,7 @@ InternalVarCheckReallocatePool ( { VOID *NewBuffer; - NewBuffer = InternalVarCheckAllocateZeroPool (NewSize); + NewBuffer = InternalVarCheckAllocateZeroPool(NewSize); if (NewBuffer != NULL && OldBuffer != NULL) { CopyMem (NewBuffer, OldBuffer, MIN (OldSize, NewSize)); InternalVarCheckFreePool(OldBuffer); @@ -572,7 +572,7 @@ MergeHiiQuestion ( // // Merge the one of options of Hii Question 2 and Hii Question 1. // - NewHiiQuestion = InternalVarCheckAllocateZeroPool (NewLength); + NewHiiQuestion = InternalVarCheckAllocateZeroPool(NewLength); ASSERT (NewHiiQuestion != NULL); CopyMem (NewHiiQuestion, HiiQuestion1, HiiQuestion1->Length); // @@ -697,7 +697,7 @@ MergeHiiQuestion ( // // Merge the one of options of Hii Question 2 and Hii Question 1. // - NewHiiQuestion = InternalVarCheckAllocateZeroPool (NewLength); + NewHiiQuestion = InternalVarCheckAllocateZeroPool(NewLength); ASSERT (NewHiiQuestion != NULL); CopyMem (NewHiiQuestion, HiiQuestion1, HiiQuestion1->Length); // @@ -897,7 +897,7 @@ ParseHiiQuestionOneOf ( Length = sizeof (*OneOf) + OptionCount * Width; - OneOf = InternalVarCheckAllocateZeroPool (Length); + OneOf = InternalVarCheckAllocateZeroPool(Length); ASSERT (OneOf != NULL); OneOf->OpCode = EFI_IFR_ONE_OF_OP; OneOf->Length = (UINT8) Length; @@ -934,7 +934,7 @@ ParseHiiQuestionCheckBox ( IfrCheckBox = (EFI_IFR_CHECKBOX *) IfrOpCodeHeader; - CheckBox = InternalVarCheckAllocateZeroPool (sizeof (*CheckBox)); + CheckBox = InternalVarCheckAllocateZeroPool(sizeof (*CheckBox)); ASSERT (CheckBox != NULL); CheckBox->OpCode = EFI_IFR_CHECKBOX_OP; CheckBox->Length = (UINT8) sizeof (*CheckBox);; @@ -972,7 +972,7 @@ ParseHiiQuestionNumeric ( IfrNumeric = (EFI_IFR_NUMERIC *) IfrOpCodeHeader; BitWidth = 0; - Numeric = InternalVarCheckAllocateZeroPool (sizeof (VAR_CHECK_HII_QUESTION_NUMERIC) + 2 * sizeof (UINT64)); + Numeric = InternalVarCheckAllocateZeroPool(sizeof (VAR_CHECK_HII_QUESTION_NUMERIC) + 2 * sizeof (UINT64)); ASSERT (Numeric != NULL); if (StoredInBitField) { @@ -1026,7 +1026,7 @@ ParseHiiQuestionOrderedList ( Length = sizeof (*OrderedList) + OptionCount * OptionWidth; - OrderedList = InternalVarCheckAllocateZeroPool (Length); + OrderedList = InternalVarCheckAllocateZeroPool(Length); ASSERT (OrderedList != NULL); OrderedList->OpCode = EFI_IFR_ORDERED_LIST_OP; OrderedList->Length = (UINT8) Length; @@ -1231,7 +1231,7 @@ CreateHiiVariableNode ( // Not found, then create new. // HeaderLength = sizeof (*HiiVariable) + VarNameSize; - HiiVariable = InternalVarCheckAllocateZeroPool (HeaderLength); + HiiVariable = InternalVarCheckAllocateZeroPool(HeaderLength); ASSERT (HiiVariable != NULL); HiiVariable->Revision = VAR_CHECK_HII_REVISION; HiiVariable->OpCode = EFI_IFR_VARSTORE_EFI_OP; @@ -1241,7 +1241,7 @@ CreateHiiVariableNode ( CopyGuid (&HiiVariable->Guid, &IfrEfiVarStore->Guid); StrCpyS ((CHAR16 *) (HiiVariable + 1), VarNameSize / sizeof (CHAR16), VarName); - HiiVariableNode = InternalVarCheckAllocateZeroPool (sizeof (*HiiVariableNode)); + HiiVariableNode = InternalVarCheckAllocateZeroPool(sizeof (*HiiVariableNode)); ASSERT (HiiVariableNode != NULL); HiiVariableNode->Signature = VAR_CHECK_HII_VARIABLE_NODE_SIGNATURE; HiiVariableNode->HiiVariable = HiiVariable; @@ -1249,7 +1249,7 @@ CreateHiiVariableNode ( // The variable store identifier, which is unique within the current form set. // HiiVariableNode->VarStoreId = IfrEfiVarStore->VarStoreId; - HiiVariableNode->HiiQuestionArray = InternalVarCheckAllocateZeroPool (IfrEfiVarStore->Size * 8 * sizeof (VAR_CHECK_HII_QUESTION_HEADER *)); + HiiVariableNode->HiiQuestionArray = InternalVarCheckAllocateZeroPool(IfrEfiVarStore->Size * 8 * sizeof (VAR_CHECK_HII_QUESTION_HEADER *)); InsertTailList (&mVarCheckHiiList, &HiiVariableNode->Link); } else { diff --git a/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGen.h b/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGen.h index c1196b366..ecaffebc6 100644 --- a/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGen.h +++ b/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGen.h @@ -49,7 +49,7 @@ DumpHiiDatabase ( **/ VOID * -InternalVarCheckAllocateZeroPool ( +InternalVarCheckAllocateZeroPool( IN UINTN AllocationSize ); diff --git a/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGenFromFv.c b/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGenFromFv.c index 0b93efc5e..a692deea3 100644 --- a/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGenFromFv.c +++ b/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGenFromFv.c @@ -79,7 +79,7 @@ GetAddressByGuid ( // if ((NumOfMatchingGuid != NULL) && (Offset != NULL)) { if (*NumOfMatchingGuid == 0) { - *Offset = InternalVarCheckAllocateZeroPool (sizeof (UINTN) * MAX_MATCH_GUID_NUM); + *Offset = InternalVarCheckAllocateZeroPool(sizeof (UINTN) * MAX_MATCH_GUID_NUM); ASSERT (*Offset != NULL); } *(*Offset + *NumOfMatchingGuid) = LoopControl + sizeof (EFI_GUID); @@ -309,7 +309,7 @@ ParseFv ( // // Need to parse all modules in all FVs. // - Key = InternalVarCheckAllocateZeroPool (Fv2->KeySize); + Key = InternalVarCheckAllocateZeroPool(Fv2->KeySize); ASSERT (Key != NULL); for (FfsIndex = 0; ; FfsIndex++) { @@ -368,7 +368,7 @@ CreateVfrDriverList ( for (Index = 0; !IsZeroGuid (&DriverGuidArray[Index]); Index++) { DEBUG ((DEBUG_INFO , "CreateVfrDriverList: %g\n", &DriverGuidArray[Index])); - VfrDriverInfo = InternalVarCheckAllocateZeroPool (sizeof (*VfrDriverInfo)); + VfrDriverInfo = InternalVarCheckAllocateZeroPool(sizeof (*VfrDriverInfo)); ASSERT (VfrDriverInfo != NULL); VfrDriverInfo->Signature = VAR_CHECK_VFR_DRIVER_INFO_SIGNATURE; VfrDriverInfo->DriverGuid = &DriverGuidArray[Index]; diff --git a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTable.c b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTable.c index a19bb991b..f1b55599e 100644 --- a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTable.c +++ b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTable.c @@ -43,7 +43,7 @@ InitializeAcpiTableDxe ( // // Initialize our protocol // - PrivateData = AllocateZeroPool (sizeof (EFI_ACPI_TABLE_INSTANCE)); + PrivateData = AllocateZeroPool(sizeof (EFI_ACPI_TABLE_INSTANCE)); ASSERT (PrivateData); PrivateData->Signature = EFI_ACPI_TABLE_SIGNATURE; diff --git a/MdeModulePkg/Universal/BdsDxe/Language.c b/MdeModulePkg/Universal/BdsDxe/Language.c index 2ab6fce8a..0de601f4f 100644 --- a/MdeModulePkg/Universal/BdsDxe/Language.c +++ b/MdeModulePkg/Universal/BdsDxe/Language.c @@ -49,7 +49,7 @@ IsLangInSupportedLangCodes( if (Iso639Language) { CompareLength = ISO_639_2_ENTRY_SIZE; - for (Index = 0; Index < AsciiStrLen (SupportedLang); Index += CompareLength) { + for (Index = 0; Index < AsciiStrLen(SupportedLang); Index += CompareLength) { if (AsciiStrnCmp (Lang, SupportedLang + Index, CompareLength) == 0) { // // Successfully find the Lang string in SupportedLang string. diff --git a/MdeModulePkg/Universal/CapsulePei/UefiCapsule.c b/MdeModulePkg/Universal/CapsulePei/UefiCapsule.c index dab132671..29ab8d723 100644 --- a/MdeModulePkg/Universal/CapsulePei/UefiCapsule.c +++ b/MdeModulePkg/Universal/CapsulePei/UefiCapsule.c @@ -907,7 +907,7 @@ GetScatterGatherHeadEntries ( // Allocate memory for sg list head // TempListLength = DEFAULT_SG_LIST_HEADS * sizeof (EFI_PHYSICAL_ADDRESS); - TempList = AllocateZeroPool (TempListLength); + TempList = AllocateZeroPool(TempListLength); if (TempList == NULL) { DEBUG((DEBUG_ERROR, "Failed to allocate memory\n")); return EFI_OUT_OF_RESOURCES; @@ -964,7 +964,7 @@ GetScatterGatherHeadEntries ( // The TempList is full, enlarge it // if ((ValidIndex + 1) >= TempListLength) { - EnlargedTempList = AllocateZeroPool (TempListLength * 2); + EnlargedTempList = AllocateZeroPool(TempListLength * 2); if (EnlargedTempList == NULL) { DEBUG ((DEBUG_ERROR, "Fail to allocate memory!\n")); return EFI_OUT_OF_RESOURCES; @@ -987,7 +987,7 @@ GetScatterGatherHeadEntries ( return EFI_NOT_FOUND; } - *HeadList = AllocateZeroPool ((ValidIndex + 1) * sizeof (EFI_PHYSICAL_ADDRESS)); + *HeadList = AllocateZeroPool((ValidIndex + 1) * sizeof (EFI_PHYSICAL_ADDRESS)); if (*HeadList == NULL) { DEBUG ((DEBUG_ERROR, "Failed to allocate memory\n")); return EFI_OUT_OF_RESOURCES; diff --git a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c index a9d298777..4a6086e72 100644 --- a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c +++ b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c @@ -811,17 +811,17 @@ ConSplitterTextOutConstructor ( // // Setup resource for mode information in Graphics Output Protocol interface // - if ((ConOutPrivate->GraphicsOutput.Mode = AllocateZeroPool (sizeof (EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE))) == NULL) { + if ((ConOutPrivate->GraphicsOutput.Mode = AllocateZeroPool(sizeof (EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE))) == NULL) { return EFI_OUT_OF_RESOURCES; } - if ((ConOutPrivate->GraphicsOutput.Mode->Info = AllocateZeroPool (sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION))) == NULL) { + if ((ConOutPrivate->GraphicsOutput.Mode->Info = AllocateZeroPool(sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION))) == NULL) { return EFI_OUT_OF_RESOURCES; } // // Setup the DevNullGraphicsOutput to 800 x 600 x 32 bits per pixel // DevNull will be updated to user-defined mode after driver has started. // - if ((ConOutPrivate->GraphicsOutputModeBuffer = AllocateZeroPool (sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION))) == NULL) { + if ((ConOutPrivate->GraphicsOutputModeBuffer = AllocateZeroPool(sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION))) == NULL) { return EFI_OUT_OF_RESOURCES; } Info = &ConOutPrivate->GraphicsOutputModeBuffer[0]; @@ -2644,7 +2644,7 @@ ConSplitterGetIntersectionBetweenConOutAndStrErr ( // Allocate the map table and set the map table's index to -1. // ConOutMapTableSize = ConOutMaxMode * sizeof (INT32); - ConOutMapTable = AllocateZeroPool (ConOutMapTableSize); + ConOutMapTable = AllocateZeroPool(ConOutMapTableSize); if (ConOutMapTable == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -2652,7 +2652,7 @@ ConSplitterGetIntersectionBetweenConOutAndStrErr ( SetMem (ConOutMapTable, ConOutMapTableSize, 0xFF); StdErrMapTableSize = StdErrMaxMode * sizeof (INT32); - StdErrMapTable = AllocateZeroPool (StdErrMapTableSize); + StdErrMapTable = AllocateZeroPool(StdErrMapTableSize); if (StdErrMapTable == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -4022,11 +4022,11 @@ ConSplitterTextInRegisterKeyNotify ( // // Allocate resource to save the notification function // - NewNotify = (TEXT_IN_EX_SPLITTER_NOTIFY *) AllocateZeroPool (sizeof (TEXT_IN_EX_SPLITTER_NOTIFY)); + NewNotify = (TEXT_IN_EX_SPLITTER_NOTIFY *) AllocateZeroPool(sizeof (TEXT_IN_EX_SPLITTER_NOTIFY)); if (NewNotify == NULL) { return EFI_OUT_OF_RESOURCES; } - NewNotify->NotifyHandleList = (EFI_HANDLE *) AllocateZeroPool (sizeof (EFI_HANDLE) * Private->TextInExListCount); + NewNotify->NotifyHandleList = (EFI_HANDLE *) AllocateZeroPool(sizeof (EFI_HANDLE) * Private->TextInExListCount); if (NewNotify->NotifyHandleList == NULL) { gBS->FreePool(NewNotify); return EFI_OUT_OF_RESOURCES; diff --git a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c index 45cfd88d8..0f431946d 100644 --- a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c +++ b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c @@ -275,7 +275,7 @@ InitializeGraphicsConsoleTextMode ( // and does not include the invalid modes which exceed the max column and row. // Reserve 2 modes for 80x25, 80x50 of graphics console. // - NewModeBuffer = AllocateZeroPool (sizeof (GRAPHICS_CONSOLE_MODE_DATA) * (Count + 2)); + NewModeBuffer = AllocateZeroPool(sizeof (GRAPHICS_CONSOLE_MODE_DATA) * (Count + 2)); ASSERT (NewModeBuffer != NULL); // @@ -1769,7 +1769,7 @@ DrawUnicodeWeightAtCursorN ( UINTN RowInfoArraySize; Private = GRAPHICS_CONSOLE_CON_OUT_DEV_FROM_THIS (This); - Blt = (EFI_IMAGE_OUTPUT *) AllocateZeroPool (sizeof (EFI_IMAGE_OUTPUT)); + Blt = (EFI_IMAGE_OUTPUT *) AllocateZeroPool(sizeof (EFI_IMAGE_OUTPUT)); if (Blt == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -1787,7 +1787,7 @@ DrawUnicodeWeightAtCursorN ( // *(String + Count) = L'\0'; - FontInfo = (EFI_FONT_DISPLAY_INFO *) AllocateZeroPool (sizeof (EFI_FONT_DISPLAY_INFO)); + FontInfo = (EFI_FONT_DISPLAY_INFO *) AllocateZeroPool(sizeof (EFI_FONT_DISPLAY_INFO)); if (FontInfo == NULL) { FreePool(Blt); FreePool(String); @@ -1826,7 +1826,7 @@ DrawUnicodeWeightAtCursorN ( UgaDraw = Private->UgaDraw; - Blt->Image.Bitmap = AllocateZeroPool (Blt->Width * Blt->Height * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)); + Blt->Image.Bitmap = AllocateZeroPool(Blt->Width * Blt->Height * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)); if (Blt->Image.Bitmap == NULL) { FreePool(Blt); FreePool(String); @@ -2062,7 +2062,7 @@ RegisterFontPackage ( // +--------------------------------+ PackageLength = sizeof (EFI_HII_SIMPLE_FONT_PACKAGE_HDR) + mNarrowFontSize + 4; - Package = AllocateZeroPool (PackageLength); + Package = AllocateZeroPool(PackageLength); ASSERT (Package != NULL); WriteUnaligned32((UINT32 *) Package,PackageLength); diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c index 35f70737d..9e9c163d4 100644 --- a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c +++ b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c @@ -669,19 +669,19 @@ TerminalDriverBindingStart ( // Allocates and initializes the FIFO buffer to be zero, used for accommodating // the pre-read pending characters. // - TerminalDevice->RawFiFo = AllocateZeroPool (sizeof (RAW_DATA_FIFO)); + TerminalDevice->RawFiFo = AllocateZeroPool(sizeof (RAW_DATA_FIFO)); if (TerminalDevice->RawFiFo == NULL) { goto FreeResources; } - TerminalDevice->UnicodeFiFo = AllocateZeroPool (sizeof (UNICODE_FIFO)); + TerminalDevice->UnicodeFiFo = AllocateZeroPool(sizeof (UNICODE_FIFO)); if (TerminalDevice->UnicodeFiFo == NULL) { goto FreeResources; } - TerminalDevice->EfiKeyFiFo = AllocateZeroPool (sizeof (EFI_KEY_FIFO)); + TerminalDevice->EfiKeyFiFo = AllocateZeroPool(sizeof (EFI_KEY_FIFO)); if (TerminalDevice->EfiKeyFiFo == NULL) { goto FreeResources; } - TerminalDevice->EfiKeyFiFoForNotify = AllocateZeroPool (sizeof (EFI_KEY_FIFO)); + TerminalDevice->EfiKeyFiFoForNotify = AllocateZeroPool(sizeof (EFI_KEY_FIFO)); if (TerminalDevice->EfiKeyFiFoForNotify == NULL) { goto FreeResources; } diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c index 043a5ac0f..05429f3b1 100644 --- a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c +++ b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c @@ -364,7 +364,7 @@ TerminalConInRegisterKeyNotify ( // // Allocate resource to save the notification function // - NewNotify = (TERMINAL_CONSOLE_IN_EX_NOTIFY *) AllocateZeroPool (sizeof (TERMINAL_CONSOLE_IN_EX_NOTIFY)); + NewNotify = (TERMINAL_CONSOLE_IN_EX_NOTIFY *) AllocateZeroPool(sizeof (TERMINAL_CONSOLE_IN_EX_NOTIFY)); if (NewNotify == NULL) { return EFI_OUT_OF_RESOURCES; } diff --git a/MdeModulePkg/Universal/DebugSupportDxe/Ia32/PlDebugSupport.c b/MdeModulePkg/Universal/DebugSupportDxe/Ia32/PlDebugSupport.c index 5e23c225f..2b38800a0 100644 --- a/MdeModulePkg/Universal/DebugSupportDxe/Ia32/PlDebugSupport.c +++ b/MdeModulePkg/Universal/DebugSupportDxe/Ia32/PlDebugSupport.c @@ -336,7 +336,7 @@ PlInitializeDebugSupportDriver ( return EFI_UNSUPPORTED; } - IdtEntryTable = AllocateZeroPool (sizeof (IDT_ENTRY) * NUM_IDT_ENTRIES); + IdtEntryTable = AllocateZeroPool(sizeof (IDT_ENTRY) * NUM_IDT_ENTRIES); if (IdtEntryTable == NULL) { return EFI_OUT_OF_RESOURCES; } diff --git a/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.c b/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.c index dd6c7629f..73392f9cb 100644 --- a/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.c +++ b/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.c @@ -466,7 +466,7 @@ DiskIoCreateSubtask ( DISK_IO_SUBTASK *Subtask; EFI_STATUS Status; - Subtask = AllocateZeroPool (sizeof (DISK_IO_SUBTASK)); + Subtask = AllocateZeroPool(sizeof (DISK_IO_SUBTASK)); if (Subtask == NULL) { return NULL; } diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Gpt.c b/MdeModulePkg/Universal/Disk/PartitionDxe/Gpt.c index 10f263f58..22e7daec7 100644 --- a/MdeModulePkg/Universal/Disk/PartitionDxe/Gpt.c +++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Gpt.c @@ -278,12 +278,12 @@ PartitionInstallGptChildHandles ( // // Allocate the GPT structures // - PrimaryHeader = AllocateZeroPool (sizeof (EFI_PARTITION_TABLE_HEADER)); + PrimaryHeader = AllocateZeroPool(sizeof (EFI_PARTITION_TABLE_HEADER)); if (PrimaryHeader == NULL) { goto Done; } - BackupHeader = AllocateZeroPool (sizeof (EFI_PARTITION_TABLE_HEADER)); + BackupHeader = AllocateZeroPool(sizeof (EFI_PARTITION_TABLE_HEADER)); if (BackupHeader == NULL) { goto Done; } @@ -349,7 +349,7 @@ PartitionInstallGptChildHandles ( DEBUG ((EFI_D_INFO, " Number of partition entries: %d\n", PrimaryHeader->NumberOfPartitionEntries)); - PEntryStatus = AllocateZeroPool (PrimaryHeader->NumberOfPartitionEntries * sizeof (EFI_PARTITION_ENTRY_STATUS)); + PEntryStatus = AllocateZeroPool(PrimaryHeader->NumberOfPartitionEntries * sizeof (EFI_PARTITION_ENTRY_STATUS)); if (PEntryStatus == NULL) { DEBUG ((EFI_D_ERROR, "Allocate pool error\n")); goto Done; @@ -479,7 +479,7 @@ PartitionValidGptTable ( BlockSize = BlockIo->Media->BlockSize; MediaId = BlockIo->Media->MediaId; - PartHdr = AllocateZeroPool (BlockSize); + PartHdr = AllocateZeroPool(BlockSize); if (PartHdr == NULL) { DEBUG ((EFI_D_ERROR, "Allocate pool error\n")); @@ -621,7 +621,7 @@ PartitionRestoreGptTable ( BlockSize = BlockIo->Media->BlockSize; MediaId = BlockIo->Media->MediaId; - PartHdr = AllocateZeroPool (BlockSize); + PartHdr = AllocateZeroPool(BlockSize); if (PartHdr == NULL) { DEBUG ((EFI_D_ERROR, "Allocate pool error\n")); diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c b/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c index 5071b498a..53cc5ca89 100644 --- a/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c +++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c @@ -1134,7 +1134,7 @@ PartitionInstallChildHandle ( PARTITION_PRIVATE_DATA *Private; Status = EFI_SUCCESS; - Private = AllocateZeroPool (sizeof (PARTITION_PRIVATE_DATA)); + Private = AllocateZeroPool(sizeof (PARTITION_PRIVATE_DATA)); if (Private == NULL) { return EFI_OUT_OF_RESOURCES; } diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c b/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c index fdba45b7e..ae62f5bbf 100644 --- a/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c +++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c @@ -204,7 +204,7 @@ FindAnchorVolumeDescriptorPointer ( // Size = MAX_CORRECTION_BLOCKS_NUM * BlockSize; - AnchorPoints = AllocateZeroPool (Size); + AnchorPoints = AllocateZeroPool(Size); if (AnchorPoints == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -504,7 +504,7 @@ FindLogicalVolumeLocation ( // // Allocate buffer for reading disk blocks // - Buffer = AllocateZeroPool ((UINTN)BlockSize); + Buffer = AllocateZeroPool((UINTN)BlockSize); if (Buffer == NULL) { return EFI_OUT_OF_RESOURCES; } diff --git a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskFileExplorer.c b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskFileExplorer.c index f8b4cdabf..fa711f088 100644 --- a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskFileExplorer.c +++ b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskFileExplorer.c @@ -47,7 +47,7 @@ GrowBuffer ( FreePool(*Buffer); } - *Buffer = AllocateZeroPool (BufferSize); + *Buffer = AllocateZeroPool(BufferSize); if (*Buffer != NULL) { TryAgain = TRUE; diff --git a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskProtocol.c b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskProtocol.c index a5d33705a..7a0fb6e41 100644 --- a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskProtocol.c +++ b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskProtocol.c @@ -242,7 +242,7 @@ RamDiskPublishNfit ( NfitHeader = (EFI_ACPI_DESCRIPTION_HEADER *)TableHeader; NfitLen = NfitHeader->Length + sizeof (EFI_ACPI_6_1_NFIT_SYSTEM_PHYSICAL_ADDRESS_RANGE_STRUCTURE); - Nfit = AllocateZeroPool (NfitLen); + Nfit = AllocateZeroPool(NfitLen); if (Nfit == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -305,7 +305,7 @@ RamDiskPublishNfit ( NfitLen = sizeof (EFI_ACPI_6_1_NVDIMM_FIRMWARE_INTERFACE_TABLE) + sizeof (EFI_ACPI_6_1_NFIT_SYSTEM_PHYSICAL_ADDRESS_RANGE_STRUCTURE); - Nfit = AllocateZeroPool (NfitLen); + Nfit = AllocateZeroPool(NfitLen); if (Nfit == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -465,7 +465,7 @@ RamDiskUnpublishNfit ( return EFI_SUCCESS; } - NewNfit = AllocateZeroPool (NewNfitLen); + NewNfit = AllocateZeroPool(NewNfitLen); if (NewNfit == NULL) { return EFI_OUT_OF_RESOURCES; } diff --git a/MdeModulePkg/Universal/Disk/UdfDxe/File.c b/MdeModulePkg/Universal/Disk/UdfDxe/File.c index b001716a9..6408a1792 100644 --- a/MdeModulePkg/Universal/Disk/UdfDxe/File.c +++ b/MdeModulePkg/Universal/Disk/UdfDxe/File.c @@ -100,7 +100,7 @@ UdfOpenVolume ( } PrivFileData = - (PRIVATE_UDF_FILE_DATA *) AllocateZeroPool (sizeof (PRIVATE_UDF_FILE_DATA)); + (PRIVATE_UDF_FILE_DATA *) AllocateZeroPool(sizeof (PRIVATE_UDF_FILE_DATA)); if (PrivFileData == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Error_Alloc_Priv_File_Data; @@ -224,7 +224,7 @@ UdfOpen ( } NewPrivFileData = - (PRIVATE_UDF_FILE_DATA *)AllocateZeroPool (sizeof (PRIVATE_UDF_FILE_DATA)); + (PRIVATE_UDF_FILE_DATA *)AllocateZeroPool(sizeof (PRIVATE_UDF_FILE_DATA)); if (NewPrivFileData == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Error_Alloc_New_Priv_File_Data; diff --git a/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c b/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c index 24eadd7f8..2b86a575e 100644 --- a/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c +++ b/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c @@ -114,7 +114,7 @@ StartMainVolumeDescriptorSequence ( // // Allocate buffer for reading disk blocks // - Buffer = AllocateZeroPool ((UINTN)BlockSize); + Buffer = AllocateZeroPool((UINTN)BlockSize); if (Buffer == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -1727,7 +1727,7 @@ FindFileEntry ( LogicalBlockSize = Volume->LogicalVolDesc.LogicalBlockSize; - ReadBuffer = AllocateZeroPool (Volume->FileEntrySize); + ReadBuffer = AllocateZeroPool(Volume->FileEntrySize); if (ReadBuffer == NULL) { return EFI_OUT_OF_RESOURCES; } diff --git a/MdeModulePkg/Universal/Disk/UdfDxe/Udf.c b/MdeModulePkg/Universal/Disk/UdfDxe/Udf.c index d8311feb8..c054087f9 100644 --- a/MdeModulePkg/Universal/Disk/UdfDxe/Udf.c +++ b/MdeModulePkg/Universal/Disk/UdfDxe/Udf.c @@ -162,7 +162,7 @@ UdfDriverBindingStart ( // PrivFsData = (PRIVATE_UDF_SIMPLE_FS_DATA *) - AllocateZeroPool (sizeof (PRIVATE_UDF_SIMPLE_FS_DATA)); + AllocateZeroPool(sizeof (PRIVATE_UDF_SIMPLE_FS_DATA)); if (PrivFsData == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Exit; diff --git a/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c b/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c index 5cd48d3b0..3c3e3499c 100644 --- a/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c +++ b/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c @@ -565,7 +565,7 @@ GetLineByWidth ( // // Need extra glyph info and '\0' info, so +2. // - *OutputString = AllocateZeroPool ((StrOffset + 2) * sizeof(CHAR16)); + *OutputString = AllocateZeroPool((StrOffset + 2) * sizeof(CHAR16)); if (*OutputString == NULL) { return 0; } @@ -653,7 +653,7 @@ UiAddMenuOption ( } for (Index = 0; Index < Count; Index++) { - MenuOption = AllocateZeroPool (sizeof (UI_MENU_OPTION)); + MenuOption = AllocateZeroPool(sizeof (UI_MENU_OPTION)); ASSERT (MenuOption); MenuOption->Signature = UI_MENU_OPTION_SIGNATURE; @@ -2282,7 +2282,7 @@ FxConfirmPopup ( // String + "?" + "\0" // MaxLen = CfmStrLen + 1 + 1; - CfmStr = AllocateZeroPool (MaxLen * sizeof (CHAR16)); + CfmStr = AllocateZeroPool(MaxLen * sizeof (CHAR16)); ASSERT (CfmStr != NULL); if ((Action & BROWSER_ACTION_DISCARD) == BROWSER_ACTION_DISCARD) { @@ -2975,7 +2975,7 @@ UiDisplayMenu ( if ((Statement->OpCode->OpCode == EFI_IFR_DATE_OP && StatementValue->Value.date.Month== 0xff)||(Statement->OpCode->OpCode == EFI_IFR_TIME_OP && StatementValue->Value.time.Hour == 0xff)){ StringRightPtr = GetToken (HelpInfo, gFormData->HiiHandle); StringErrorPtr = GetToken (STRING_TOKEN (GET_TIME_FAIL), gHiiHandle); - StringPtr = AllocateZeroPool ((StrLen (StringRightPtr) + StrLen (StringErrorPtr)+ 1 ) * sizeof (CHAR16)); + StringPtr = AllocateZeroPool((StrLen (StringRightPtr) + StrLen (StringErrorPtr)+ 1 ) * sizeof (CHAR16)); StrCpyS (StringPtr, StrLen (StringRightPtr) + StrLen (StringErrorPtr) + 1, StringRightPtr); StrCatS (StringPtr, StrLen (StringRightPtr) + StrLen (StringErrorPtr) + 1, StringErrorPtr); FreePool(StringRightPtr); diff --git a/MdeModulePkg/Universal/DisplayEngineDxe/InputHandler.c b/MdeModulePkg/Universal/DisplayEngineDxe/InputHandler.c index d5655e6ba..f06a9bb64 100644 --- a/MdeModulePkg/Universal/DisplayEngineDxe/InputHandler.c +++ b/MdeModulePkg/Universal/DisplayEngineDxe/InputHandler.c @@ -98,7 +98,7 @@ ReadString ( } MaxLen = Maximum + 1; - TempString = AllocateZeroPool (MaxLen * sizeof (CHAR16)); + TempString = AllocateZeroPool(MaxLen * sizeof (CHAR16)); ASSERT (TempString); if (ScreenSize < (Maximum + 1)) { @@ -109,7 +109,7 @@ ReadString ( ScreenSize = DimensionsWidth - 2; } - BufferedString = AllocateZeroPool (ScreenSize * 2); + BufferedString = AllocateZeroPool(ScreenSize * 2); ASSERT (BufferedString); Start = (DimensionsWidth - ScreenSize - 2) / 2 + gStatementDimensions.LeftColumn + 1; @@ -1136,7 +1136,7 @@ AdjustOptionOrder ( // // Prepare HiiValue array // - HiiValueArray = AllocateZeroPool (*PopUpMenuLines * sizeof (EFI_HII_VALUE)); + HiiValueArray = AllocateZeroPool(*PopUpMenuLines * sizeof (EFI_HII_VALUE)); ASSERT (HiiValueArray != NULL); for (Index = 0; Index < *PopUpMenuLines; Index++) { @@ -1435,7 +1435,7 @@ GetSelectionInputPopUp ( // and append a "..." for indication. // if (StrLen (StringPtr) > (PopUpWidth - 1)) { - TempStringPtr = AllocateZeroPool (sizeof (CHAR16) * (PopUpWidth - 1)); + TempStringPtr = AllocateZeroPool(sizeof (CHAR16) * (PopUpWidth - 1)); ASSERT ( TempStringPtr != NULL ); CopyMem (TempStringPtr, StringPtr, (sizeof (CHAR16) * (PopUpWidth - 5))); FreePool(StringPtr); @@ -1619,7 +1619,7 @@ TheKey: // return the current selection // if (OrderedList) { - ReturnValue = AllocateZeroPool (Question->CurrentValue.BufferLen); + ReturnValue = AllocateZeroPool(Question->CurrentValue.BufferLen); ASSERT (ReturnValue != NULL); Index = 0; Link = GetFirstNode (&Question->OptionListHead); diff --git a/MdeModulePkg/Universal/DisplayEngineDxe/Popup.c b/MdeModulePkg/Universal/DisplayEngineDxe/Popup.c index 9150b154d..2259a5ea4 100644 --- a/MdeModulePkg/Universal/DisplayEngineDxe/Popup.c +++ b/MdeModulePkg/Universal/DisplayEngineDxe/Popup.c @@ -80,7 +80,7 @@ AddOneSelectableOption ( { USER_SELECTABLE_OPTION *UserSelectableOption; - UserSelectableOption = AllocateZeroPool (sizeof (USER_SELECTABLE_OPTION)); + UserSelectableOption = AllocateZeroPool(sizeof (USER_SELECTABLE_OPTION)); if (UserSelectableOption == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -387,7 +387,7 @@ ParseMessageString ( // // Copy the string to OutputString buffer and calculate the width of OutputString. // - *OutputString = AllocateZeroPool ((StrOffset + 1) * sizeof(CHAR16)); + *OutputString = AllocateZeroPool((StrOffset + 1) * sizeof(CHAR16)); if (*OutputString == NULL) { return 0; } @@ -586,7 +586,7 @@ DrawMessageBox ( //OutputStrWidth > MaxMesStrWidth, cut off the string and print print ... instead. // GetStringOffsetWithWidth (OutputString, gMaxRowWidth, &Length); - TempString = AllocateZeroPool ((Length + 1) * sizeof (CHAR16)); + TempString = AllocateZeroPool((Length + 1) * sizeof (CHAR16)); if (TempString == NULL) { FreePool(OutputString); return EFI_OUT_OF_RESOURCES; diff --git a/MdeModulePkg/Universal/DisplayEngineDxe/ProcessOptions.c b/MdeModulePkg/Universal/DisplayEngineDxe/ProcessOptions.c index 7c3e8cba3..0ac75bb26 100644 --- a/MdeModulePkg/Universal/DisplayEngineDxe/ProcessOptions.c +++ b/MdeModulePkg/Universal/DisplayEngineDxe/ProcessOptions.c @@ -796,7 +796,7 @@ PasswordProcess ( Maximum = PasswordInfo->MaxSize; Status = EFI_SUCCESS; - StringPtr = AllocateZeroPool ((Maximum + 1) * sizeof (CHAR16)); + StringPtr = AllocateZeroPool((Maximum + 1) * sizeof (CHAR16)); ASSERT (StringPtr); // @@ -863,7 +863,7 @@ PasswordProcess ( // // Confirm new password // - TempString = AllocateZeroPool ((Maximum + 1) * sizeof (CHAR16)); + TempString = AllocateZeroPool((Maximum + 1) * sizeof (CHAR16)); ASSERT (TempString); Status = ReadString (MenuOption, gConfirmPassword, TempString); if (EFI_ERROR(Status)) { @@ -992,7 +992,7 @@ ProcessOptions ( // space required for the array or strings. // MaxLen = OrderList->MaxContainers * BufferSize / sizeof (CHAR16); - *OptionString = AllocateZeroPool (MaxLen * sizeof (CHAR16)); + *OptionString = AllocateZeroPool(MaxLen * sizeof (CHAR16)); ASSERT (*OptionString); HiiValue.Type = ValueType; @@ -1028,7 +1028,7 @@ ProcessOptions ( // gUserInput->SelectedStatement = Question; gMisMatch = TRUE; - ValueArray = AllocateZeroPool (Question->CurrentValue.BufferLen); + ValueArray = AllocateZeroPool(Question->CurrentValue.BufferLen); ASSERT (ValueArray != NULL); gUserInput->InputValue.Buffer = ValueArray; gUserInput->InputValue.BufferLen = Question->CurrentValue.BufferLen; @@ -1145,7 +1145,7 @@ ProcessOptions ( Status = GetSelectionInputPopUp (MenuOption); } else { MaxLen = BufferSize / sizeof(CHAR16); - *OptionString = AllocateZeroPool (BufferSize); + *OptionString = AllocateZeroPool(BufferSize); ASSERT (*OptionString); OneOfOption = ValueToOption (Question, QuestionValue); @@ -1222,7 +1222,7 @@ ProcessOptions ( // return EFI_SUCCESS; } else { - *OptionString = AllocateZeroPool (BufferSize); + *OptionString = AllocateZeroPool(BufferSize); ASSERT (*OptionString); *OptionString[0] = LEFT_CHECKBOX_DELIMITER; @@ -1243,7 +1243,7 @@ ProcessOptions ( // Status = GetNumericInput (MenuOption); } else { - *OptionString = AllocateZeroPool (BufferSize); + *OptionString = AllocateZeroPool(BufferSize); ASSERT (*OptionString); *OptionString[0] = LEFT_NUMERIC_DELIMITER; @@ -1266,7 +1266,7 @@ ProcessOptions ( // Status = GetNumericInput (MenuOption); } else { - *OptionString = AllocateZeroPool (BufferSize); + *OptionString = AllocateZeroPool(BufferSize); ASSERT (*OptionString); switch (MenuOption->Sequence) { @@ -1310,7 +1310,7 @@ ProcessOptions ( // Status = GetNumericInput (MenuOption); } else { - *OptionString = AllocateZeroPool (BufferSize); + *OptionString = AllocateZeroPool(BufferSize); ASSERT (*OptionString); switch (MenuOption->Sequence) { @@ -1349,7 +1349,7 @@ ProcessOptions ( case EFI_IFR_STRING_OP: if (Selected) { - StringPtr = AllocateZeroPool (Question->CurrentValue.BufferLen + sizeof (CHAR16)); + StringPtr = AllocateZeroPool(Question->CurrentValue.BufferLen + sizeof (CHAR16)); ASSERT (StringPtr); CopyMem(StringPtr, Question->CurrentValue.Buffer, Question->CurrentValue.BufferLen); @@ -1366,7 +1366,7 @@ ProcessOptions ( FreePool(StringPtr); return EFI_SUCCESS; } else { - *OptionString = AllocateZeroPool (BufferSize); + *OptionString = AllocateZeroPool(BufferSize); ASSERT (*OptionString); if (((CHAR16 *) Question->CurrentValue.Buffer)[0] == 0x0000) { @@ -1446,7 +1446,7 @@ ProcessHelpString ( } *EachLineWidth = MaxStringLen; - *FormattedString = AllocateZeroPool (TotalRowNum * MaxStringLen * sizeof (CHAR16)); + *FormattedString = AllocateZeroPool(TotalRowNum * MaxStringLen * sizeof (CHAR16)); ASSERT (*FormattedString != NULL); // diff --git a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c index 338607bb3..41f19072a 100644 --- a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c +++ b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c @@ -324,7 +324,7 @@ GetValueOfNumber ( *Len = StringPtr - TmpPtr; Length = *Len + 1; - Str = (EFI_STRING) AllocateZeroPool (Length * sizeof (CHAR16)); + Str = (EFI_STRING) AllocateZeroPool(Length * sizeof (CHAR16)); if (Str == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Exit; @@ -333,7 +333,7 @@ GetValueOfNumber ( *(Str + *Len) = L'\0'; Length = (Length + 1) / 2; - Buf = (UINT8 *) AllocateZeroPool (Length); + Buf = (UINT8 *) AllocateZeroPool(Length); if (Buf == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Exit; @@ -390,7 +390,7 @@ CreateAltCfgString ( // String Len = ConfigResp + AltConfig + AltConfig + 1("\0") // NewLen = (NewLen + ((1 + StrLen (ConfigHdr) + 8 + 4) + (8 + 4 + 7 + 4 + 7 + 4)) * 2 + 1) * sizeof (CHAR16); - StringPtr = AllocateZeroPool (NewLen); + StringPtr = AllocateZeroPool(NewLen); if (StringPtr == NULL) { return NULL; } @@ -640,7 +640,7 @@ ExtractConfig ( // ConfigRequestHdr = HiiConstructConfigHdr (&gDriverSampleFormSetGuid, VariableName, PrivateData->DriverHandle[0]); Size = (StrLen (ConfigRequestHdr) + 32 + 1) * sizeof (CHAR16); - ConfigRequest = AllocateZeroPool (Size); + ConfigRequest = AllocateZeroPool(Size); ASSERT (ConfigRequest != NULL); AllocatedRequest = TRUE; UnicodeSPrint (ConfigRequest, Size, L"%s&OFFSET=0&WIDTH=%016LX", ConfigRequestHdr, (UINT64)BufferSize); @@ -685,7 +685,7 @@ ExtractConfig ( } if (StrStr (StrPointer, L"&") == NULL) { Size = (StrLen (Request) + 32 + 1) * sizeof (CHAR16); - ConfigRequest = AllocateZeroPool (Size); + ConfigRequest = AllocateZeroPool(Size); ASSERT (ConfigRequest != NULL); AllocatedRequest = TRUE; UnicodeSPrint (ConfigRequest, Size, L"%s&OFFSET=0&WIDTH=%016LX", Request, (UINT64)BufferSize); @@ -714,7 +714,7 @@ ExtractConfig ( 1 + sizeof (PrivateData->Configuration.NameValueVar0) * 2 + 1 + sizeof (PrivateData->Configuration.NameValueVar1) * 2 + 1 + sizeof (PrivateData->Configuration.NameValueVar2) * 2 + 1) * sizeof (CHAR16); - *Results = AllocateZeroPool (BufferSize); + *Results = AllocateZeroPool(BufferSize); ASSERT (*Results != NULL); StrCpyS (*Results, BufferSize / sizeof (CHAR16), ConfigRequest); Value = *Results; @@ -1275,7 +1275,7 @@ DriverCallback ( // // Update uncommitted data of Browser // - EfiData = AllocateZeroPool (sizeof (MY_EFI_VARSTORE_DATA)); + EfiData = AllocateZeroPool(sizeof (MY_EFI_VARSTORE_DATA)); ASSERT (EfiData != NULL); if (HiiGetBrowserData (&gDriverSampleFormSetGuid, MyEfiVar, sizeof (MY_EFI_VARSTORE_DATA), (UINT8 *) EfiData)) { EfiData->Field8 = 111; @@ -1418,7 +1418,7 @@ DriverCallback ( // // Set initial vlaue of dynamic created oneof Question in Form Browser // - Configuration = AllocateZeroPool (sizeof (DRIVER_SAMPLE_CONFIGURATION)); + Configuration = AllocateZeroPool(sizeof (DRIVER_SAMPLE_CONFIGURATION)); ASSERT (Configuration != NULL); if (HiiGetBrowserData (&gDriverSampleFormSetGuid, VariableName, sizeof (DRIVER_SAMPLE_CONFIGURATION), (UINT8 *) Configuration)) { Configuration->DynamicOneof = 2; @@ -1747,7 +1747,7 @@ DriverSampleInit ( // // Initialize driver private data // - mPrivateData = AllocateZeroPool (sizeof (DRIVER_SAMPLE_PRIVATE_DATA)); + mPrivateData = AllocateZeroPool(sizeof (DRIVER_SAMPLE_PRIVATE_DATA)); if (mPrivateData == NULL) { return EFI_OUT_OF_RESOURCES; } diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbHook.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbHook.c index cadcd4e1d..2ca628bbe 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbHook.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbHook.c @@ -344,17 +344,17 @@ EbcDebuggerHookInit ( // // Init Symbol // - Object = AllocateZeroPool (sizeof(EFI_DEBUGGER_SYMBOL_OBJECT) * EFI_DEBUGGER_SYMBOL_OBJECT_MAX); + Object = AllocateZeroPool(sizeof(EFI_DEBUGGER_SYMBOL_OBJECT) * EFI_DEBUGGER_SYMBOL_OBJECT_MAX); ASSERT (Object != NULL); mDebuggerPrivate.DebuggerSymbolContext.Object = Object; mDebuggerPrivate.DebuggerSymbolContext.ObjectCount = 0; mDebuggerPrivate.DebuggerSymbolContext.MaxObjectCount = EFI_DEBUGGER_SYMBOL_OBJECT_MAX; for (Index = 0; Index < EFI_DEBUGGER_SYMBOL_OBJECT_MAX; Index++) { - Entry = AllocateZeroPool (sizeof(EFI_DEBUGGER_SYMBOL_ENTRY) * EFI_DEBUGGER_SYMBOL_ENTRY_MAX); + Entry = AllocateZeroPool(sizeof(EFI_DEBUGGER_SYMBOL_ENTRY) * EFI_DEBUGGER_SYMBOL_ENTRY_MAX); ASSERT (Entry != NULL); Object[Index].Entry = Entry; Object[Index].MaxEntryCount = EFI_DEBUGGER_SYMBOL_ENTRY_MAX; - Object[Index].SourceBuffer = AllocateZeroPool (sizeof(VOID *) * (EFI_DEBUGGER_SYMBOL_ENTRY_MAX + 1)); + Object[Index].SourceBuffer = AllocateZeroPool(sizeof(VOID *) * (EFI_DEBUGGER_SYMBOL_ENTRY_MAX + 1)); ASSERT (Object[Index].SourceBuffer != NULL); } diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSupportFile.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSupportFile.c index d25fa9dcb..7d839c0b9 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSupportFile.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSupportFile.c @@ -67,7 +67,7 @@ ReadFileFromVol ( // FileInfoSize = sizeof(EFI_FILE_INFO) + 1024; - FileInfo = AllocateZeroPool (FileInfoSize); + FileInfo = AllocateZeroPool(FileInfoSize); if (FileInfo == NULL) { Handle->Close (Handle); return Status; @@ -89,7 +89,7 @@ ReadFileFromVol ( // Allocate buffer for the file data. The last CHAR16 is for L'\0' // TempBufferSize = (UINTN) FileInfo->FileSize + sizeof(CHAR16); - TempBuffer = AllocateZeroPool (TempBufferSize); + TempBuffer = AllocateZeroPool(TempBufferSize); if (TempBuffer == NULL) { Handle->Close (Handle); gBS->FreePool(FileInfo); @@ -327,7 +327,7 @@ GetFileNameUnderDir ( // FileInfoSize = sizeof(EFI_FILE_INFO) + 1024; - FileInfo = AllocateZeroPool (FileInfoSize); + FileInfo = AllocateZeroPool(FileInfoSize); if (FileInfo == NULL) { Handle->Close (Handle); return NULL; diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSupportString.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSupportString.c index 9679a2300..bae3e29fc 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSupportString.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSupportString.c @@ -438,7 +438,7 @@ StrDuplicate ( UINTN Size; Size = (StrLen(Src) + 1) * sizeof(CHAR16); - Dest = AllocateZeroPool (Size); + Dest = AllocateZeroPool(Size); if (Dest != NULL) { CopyMem (Dest, Src, Size); } diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c index 067fe4f01..49d7b131b 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c @@ -245,13 +245,13 @@ EdbLoadSymbolEntryByIec ( // // Get the Name // - if (AsciiStrnCmp (FieldBuffer, "___safe_se_handler", AsciiStrLen ("___safe_se_handler")) == 0) { + if (AsciiStrnCmp (FieldBuffer, "___safe_se_handler", AsciiStrLen("___safe_se_handler")) == 0) { // // skip SeHandler // MapParseState = EdbEbcMapParseStateSeHandlerSymbol; goto ExitFieldParse; - } else if (AsciiStrnCmp (FieldBuffer, "varbss_init", AsciiStrLen ("varbss_init")) == 0) { + } else if (AsciiStrnCmp (FieldBuffer, "varbss_init", AsciiStrLen("varbss_init")) == 0) { // // check VarbssInit // @@ -259,7 +259,7 @@ EdbLoadSymbolEntryByIec ( // goto ExitFieldParse; Name = FieldBuffer; SymbolParseState = EdbEbcSymbolParseStateReadyForRVA; - } else if (AsciiStrnCmp (FieldBuffer, "Crt", AsciiStrLen ("Crt")) == 0) { + } else if (AsciiStrnCmp (FieldBuffer, "Crt", AsciiStrLen("Crt")) == 0) { // // check Crt // @@ -872,7 +872,7 @@ MatchPdbAndMap ( // // get size // - PdbNameSize = AsciiStrLen (PdbFileName); + PdbNameSize = AsciiStrLen(PdbFileName); MapNameSize = StrLen (MapFileName); if (PdbNameSize != MapNameSize) { @@ -1116,7 +1116,7 @@ MatchObjAndCod ( // // get size // - ObjNameSize = AsciiStrLen (ObjFileName); + ObjNameSize = AsciiStrLen(ObjFileName); CodNameSize = StrLen (CodFileName); if (ObjNameSize != CodNameSize) { diff --git a/MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c b/MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c index 3b7ebebf9..92c0cb104 100644 --- a/MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c +++ b/MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c @@ -321,7 +321,7 @@ FmpGetFirmwareImageDescriptor ( return NULL; } - FmpImageInfoBuf = AllocateZeroPool (ImageInfoSize); + FmpImageInfoBuf = AllocateZeroPool(ImageInfoSize); if (FmpImageInfoBuf == NULL) { DEBUG ((DEBUG_ERROR, "EsrtFmpDxe: Failed to get memory for FMP descriptor.\n")); return NULL; @@ -412,7 +412,7 @@ CreateFmpBasedEsrt ( // // Allocate ESRT Table and GUID/HardwareInstance table // - Table = AllocateZeroPool ( + Table = AllocateZeroPool( (NumberOfDescriptors * sizeof (EFI_SYSTEM_RESOURCE_ENTRY)) + sizeof (EFI_SYSTEM_RESOURCE_TABLE) ); if (Table == NULL) { @@ -421,7 +421,7 @@ CreateFmpBasedEsrt ( return NULL; } - HardwareInstances = AllocateZeroPool (NumberOfDescriptors * sizeof (GUID_HARDWAREINSTANCE_PAIR)); + HardwareInstances = AllocateZeroPool(NumberOfDescriptors * sizeof (GUID_HARDWAREINSTANCE_PAIR)); if (HardwareInstances == NULL) { DEBUG ((DEBUG_ERROR, "EsrtFmpDxe: Failed to allocate memory for HW Instance Table.\n")); FreePool(Table); diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmmDxe.c b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmmDxe.c index 628ca22f7..7bc21d7b9 100644 --- a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmmDxe.c +++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmmDxe.c @@ -46,7 +46,7 @@ InitCommunicateBuffer ( // // The whole buffer size: SMM_COMMUNICATE_HEADER_SIZE + SMM_FTW_COMMUNICATE_HEADER_SIZE + DataSize. // - SmmCommunicateHeader = AllocateZeroPool (DataSize + SMM_COMMUNICATE_HEADER_SIZE + SMM_FTW_COMMUNICATE_HEADER_SIZE); + SmmCommunicateHeader = AllocateZeroPool(DataSize + SMM_COMMUNICATE_HEADER_SIZE + SMM_FTW_COMMUNICATE_HEADER_SIZE); ASSERT (SmmCommunicateHeader != NULL); // diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c index 730f8e2a1..d4f14c013 100644 --- a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c +++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c @@ -973,7 +973,7 @@ InitFtwDevice ( // Allocate private data of this driver, // Including the FtwWorkSpace[FTW_WORK_SPACE_SIZE]. // - FtwDevice = AllocateZeroPool (sizeof (EFI_FTW_DEVICE) + PcdGet32 (PcdFlashNvStorageFtwWorkingSize)); + FtwDevice = AllocateZeroPool(sizeof (EFI_FTW_DEVICE) + PcdGet32 (PcdFlashNvStorageFtwWorkingSize)); if (FtwDevice == NULL) { return EFI_OUT_OF_RESOURCES; } diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/UpdateWorkingBlock.c b/MdeModulePkg/Universal/FaultTolerantWriteDxe/UpdateWorkingBlock.c index 06c922e8b..8b2620a79 100644 --- a/MdeModulePkg/Universal/FaultTolerantWriteDxe/UpdateWorkingBlock.c +++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/UpdateWorkingBlock.c @@ -378,7 +378,7 @@ FtwReclaimWorkSpace ( // Read all original data from working block to a memory buffer // TempBufferSize = FtwDevice->NumberOfWorkBlock * FtwDevice->WorkBlockSize; - TempBuffer = AllocateZeroPool (TempBufferSize); + TempBuffer = AllocateZeroPool(TempBufferSize); if (TempBuffer == NULL) { return EFI_OUT_OF_RESOURCES; } diff --git a/MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystem.c b/MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystem.c index 1b65c483f..0b6d732d1 100644 --- a/MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystem.c +++ b/MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystem.c @@ -509,7 +509,7 @@ FvSimpleFileSystemOpen ( // Check for opening root // if (StrCmp (FileName, L".") == 0 || StrCmp (FileName, L"") == 0) { - NewFile = AllocateZeroPool (sizeof (FV_FILESYSTEM_FILE)); + NewFile = AllocateZeroPool(sizeof (FV_FILESYSTEM_FILE)); if (NewFile == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -573,7 +573,7 @@ FvSimpleFileSystemOpen ( } if (!EFI_ERROR(Status)) { - NewFile = AllocateZeroPool (sizeof (FV_FILESYSTEM_FILE)); + NewFile = AllocateZeroPool(sizeof (FV_FILESYSTEM_FILE)); if (NewFile == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -691,7 +691,7 @@ FvSimpleFileSystemRead ( } else { FileSize = (UINTN)File->FvFileInfo->FileInfo.FileSize; - FileBuffer = AllocateZeroPool (FileSize); + FileBuffer = AllocateZeroPool(FileSize); if (FileBuffer == NULL) { return EFI_DEVICE_ERROR; } diff --git a/MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystemEntryPoint.c b/MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystemEntryPoint.c index 537af23d7..5a299dfdc 100644 --- a/MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystemEntryPoint.c +++ b/MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystemEntryPoint.c @@ -102,7 +102,7 @@ FvSimpleFileSystemOpenVolume ( // // Allocate file structure for root file // - Root = AllocateZeroPool (sizeof (FV_FILESYSTEM_FILE)); + Root = AllocateZeroPool(sizeof (FV_FILESYSTEM_FILE)); if (Root == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -111,7 +111,7 @@ FvSimpleFileSystemOpenVolume ( Root->Instance = Instance; Root->Signature = FVFS_FILE_SIGNATURE; CopyMem (&Root->FileProtocol, &mFileSystemTemplate, sizeof (mFileSystemTemplate)); - Root->FvFileInfo = AllocateZeroPool (sizeof (FV_FILESYSTEM_FILE_INFO)); + Root->FvFileInfo = AllocateZeroPool(sizeof (FV_FILESYSTEM_FILE_INFO)); if (Root->FvFileInfo == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -161,7 +161,7 @@ FvSimpleFileSystemOpenVolume ( if (!EFI_ERROR(Status)) { Name = UiSection; } else { - Name = AllocateZeroPool (GUID_STRING_SIZE); + Name = AllocateZeroPool(GUID_STRING_SIZE); if (Name == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -178,7 +178,7 @@ FvSimpleFileSystemOpenVolume ( NameLen += StrSize (L".efi") - sizeof (CHAR16); } - FvFileInfo = AllocateZeroPool (sizeof (FV_FILESYSTEM_FILE_INFO) + NameLen - sizeof (CHAR16)); + FvFileInfo = AllocateZeroPool(sizeof (FV_FILESYSTEM_FILE_INFO) + NameLen - sizeof (CHAR16)); if (FvFileInfo == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -449,7 +449,7 @@ FvSimpleFileSystemDriverStart ( // // Create an instance // - Instance = AllocateZeroPool (sizeof (FV_FILESYSTEM_INSTANCE)); + Instance = AllocateZeroPool(sizeof (FV_FILESYSTEM_INSTANCE)); ASSERT (Instance != NULL); Instance->Root = NULL; @@ -490,7 +490,7 @@ FvSimpleFileSystemDriverStart ( // // Allocate the volume label // - Instance->VolumeLabel = AllocateZeroPool (FVFS_VOLUME_LABEL_SIZE); + Instance->VolumeLabel = AllocateZeroPool(FVFS_VOLUME_LABEL_SIZE); // // Check the allocation was successful // diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c index 670582daa..7f3f47e11 100644 --- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c @@ -109,7 +109,7 @@ ExtractDevicePath ( // as the device path resides in RAM memory. // Translate the data into binary. // - DevicePathBuffer = (UINT8 *) AllocateZeroPool ((Length + 1) / 2); + DevicePathBuffer = (UINT8 *) AllocateZeroPool((Length + 1) / 2); if (DevicePathBuffer == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -1339,7 +1339,7 @@ GetStringIdFromRecord ( for (Link = PackageListNode->StringPkgHdr.ForwardLink; Link != &PackageListNode->StringPkgHdr; Link = Link->ForwardLink) { StringPackage = CR (Link, HII_STRING_PACKAGE_INSTANCE, StringEntry, HII_STRING_PACKAGE_SIGNATURE); - if (AsciiStrnCmp(Name, StringPackage->StringPkgHdr->Language, AsciiStrLen (Name)) == 0) { + if (AsciiStrnCmp(Name, StringPackage->StringPkgHdr->Language, AsciiStrLen(Name)) == 0) { Status = GetStringIdFromString (StringPackage, KeywordValue, StringId); if (EFI_ERROR(Status)) { return KEYWORD_HANDLER_KEYWORD_NOT_FOUND; @@ -1703,7 +1703,7 @@ ConstructConfigHdr ( if (AsciiName != NULL) { NameSize = AsciiStrSize (AsciiName); - Name = AllocateZeroPool (NameSize * sizeof (CHAR16)); + Name = AllocateZeroPool(NameSize * sizeof (CHAR16)); ASSERT (Name != NULL); AsciiStrToUnicodeStrS (AsciiName, Name, NameSize); } else { @@ -1740,7 +1740,7 @@ ConstructConfigHdr ( // | 5 | sizeof (EFI_GUID) * 2 | 6 | NameStrLen*4 | 6 | DevicePathSize * 2 | 1 | // MaxLen = 5 + sizeof (EFI_GUID) * 2 + 6 + NameLength * 4 + 6 + DevicePathSize * 2 + 1; - String = AllocateZeroPool (MaxLen * sizeof (CHAR16)); + String = AllocateZeroPool(MaxLen * sizeof (CHAR16)); if (String == NULL) { return NULL; } @@ -1862,7 +1862,7 @@ ConstructRequestElement ( // // Allocate buffer for the entire // - StringPtr = AllocateZeroPool (Length * sizeof (CHAR16)); + StringPtr = AllocateZeroPool(Length * sizeof (CHAR16)); ASSERT (StringPtr != NULL); if (Name != NULL) { @@ -1933,7 +1933,7 @@ GetNameFromId ( NULL ); if (BestLanguage == NULL) { - BestLanguage = AllocateCopyPool(AsciiStrLen ("en-US"), "en-US"); + BestLanguage = AllocateCopyPool(AsciiStrLen("en-US"), "en-US"); ASSERT (BestLanguage != NULL); } @@ -1951,7 +1951,7 @@ GetNameFromId ( goto Done; } - Name = AllocateZeroPool (StringSize); + Name = AllocateZeroPool(StringSize); if (Name == NULL) { goto Done; } @@ -2411,7 +2411,7 @@ GenerateKeywordResp ( // 1.1 NameSpaceId size. // 'NAMESPACE=' // - NameSpaceLength = AsciiStrLen (NameSpace); + NameSpaceLength = AsciiStrLen(NameSpace); RespStrLen = 10 + NameSpaceLength; UnicodeNameSpace = AllocatePool ((NameSpaceLength + 1) * sizeof (CHAR16)); if (UnicodeNameSpace == NULL) { @@ -2627,7 +2627,7 @@ EnumerateAllKeywords ( // // Check whether has keyword string package. // - if (AsciiStrnCmp(NameSpace, StringPackage->StringPkgHdr->Language, AsciiStrLen (NameSpace)) == 0) { + if (AsciiStrnCmp(NameSpace, StringPackage->StringPkgHdr->Language, AsciiStrLen(NameSpace)) == 0) { FindKeywordPackages = TRUE; // // Keep the NameSpace string. @@ -2877,7 +2877,7 @@ EfiConfigKeywordHandlerSetData ( // // 1.1 Check whether the input namespace is valid. // - if (AsciiStrnCmp(NameSpace, UEFI_CONFIG_LANG, AsciiStrLen (UEFI_CONFIG_LANG)) != 0) { + if (AsciiStrnCmp(NameSpace, UEFI_CONFIG_LANG, AsciiStrLen(UEFI_CONFIG_LANG)) != 0) { *ProgressErr = KEYWORD_HANDLER_MALFORMED_STRING; Status = EFI_INVALID_PARAMETER; goto Done; @@ -3177,7 +3177,7 @@ EfiConfigKeywordHandlerGetData ( // 1.1 Check whether the input namespace is valid. // if (NameSpace != NULL){ - if (AsciiStrnCmp(NameSpace, UEFI_CONFIG_LANG, AsciiStrLen (UEFI_CONFIG_LANG)) != 0) { + if (AsciiStrnCmp(NameSpace, UEFI_CONFIG_LANG, AsciiStrLen(UEFI_CONFIG_LANG)) != 0) { *ProgressErr = KEYWORD_HANDLER_MALFORMED_STRING; return EFI_INVALID_PARAMETER; } diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c index 537b3c26b..8dd3e8c99 100644 --- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c @@ -117,7 +117,7 @@ GetDevicePath ( // as the device path resides in RAM memory. // Translate the data into binary. // - DevicePathBuffer = (UINT8 *) AllocateZeroPool ((Length + 1) / 2); + DevicePathBuffer = (UINT8 *) AllocateZeroPool((Length + 1) / 2); if (DevicePathBuffer == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -243,7 +243,7 @@ GenerateSubStr ( // Header + Data + '&' + '\0' // Length = StrLen (String) + BufferLen * 2 + 1 + 1; - Str = AllocateZeroPool (Length * sizeof (CHAR16)); + Str = AllocateZeroPool(Length * sizeof (CHAR16)); ASSERT (Str != NULL); StrCpyS (Str, Length, String); @@ -486,7 +486,7 @@ GetValueOfNumber ( *Len = StringPtr - TmpPtr; Length = *Len + 1; - Str = (EFI_STRING) AllocateZeroPool (Length * sizeof (CHAR16)); + Str = (EFI_STRING) AllocateZeroPool(Length * sizeof (CHAR16)); if (Str == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Exit; @@ -495,7 +495,7 @@ GetValueOfNumber ( *(Str + *Len) = L'\0'; Length = (Length + 1) / 2; - Buf = (UINT8 *) AllocateZeroPool (Length); + Buf = (UINT8 *) AllocateZeroPool(Length); if (Buf == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Exit; @@ -666,7 +666,7 @@ CompareBlockElementDefault ( // Copy the to AppendString. // if (AppendString == NULL) { - AppendString = (EFI_STRING) AllocateZeroPool (AppendSize + sizeof (CHAR16)); + AppendString = (EFI_STRING) AllocateZeroPool(AppendSize + sizeof (CHAR16)); StrnCatS (AppendString, AppendSize / sizeof (CHAR16) + 1, BlockPtrStart, AppendSize / sizeof (CHAR16)); } else { TotalSize = StrSize (AppendString) + AppendSize + sizeof (CHAR16); @@ -799,7 +799,7 @@ CompareNameElementDefault ( // Copy the to AppendString. // if (AppendString == NULL) { - AppendString = (EFI_STRING) AllocateZeroPool (AppendSize + sizeof (CHAR16)); + AppendString = (EFI_STRING) AllocateZeroPool(AppendSize + sizeof (CHAR16)); StrnCatS (AppendString, AppendSize / sizeof (CHAR16) + 1, NvConfigStart, AppendSize / sizeof (CHAR16)); } else { TotalSize = StrSize (AppendString) + AppendSize + sizeof (CHAR16); @@ -969,7 +969,7 @@ CompareAndMergeDefaultString ( ReallocateSize = StrSize (ConfigAltResp) + sizeof (CHAR16); } - AltCfgRespBackup = (EFI_STRING) AllocateZeroPool (ReallocateSize); + AltCfgRespBackup = (EFI_STRING) AllocateZeroPool(ReallocateSize); if (AltCfgRespBackup == NULL) { goto Exit; } @@ -1067,7 +1067,7 @@ MergeDefaultString ( // |1| StrLen (ConfigHdr) | 8 | 4 | 1 | // MaxLen = 1 + HeaderLength + 8 + 4 + 1; - AltConfigHdr = AllocateZeroPool (MaxLen * sizeof (CHAR16)); + AltConfigHdr = AllocateZeroPool(MaxLen * sizeof (CHAR16)); if (AltConfigHdr == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -1183,7 +1183,7 @@ InsertDefaultValue ( // // Insert new default value data in tail. // - DefaultValueArray = AllocateZeroPool (sizeof (IFR_DEFAULT_DATA)); + DefaultValueArray = AllocateZeroPool(sizeof (IFR_DEFAULT_DATA)); ASSERT (DefaultValueArray != NULL); CopyMem (DefaultValueArray, DefaultValueData, sizeof (IFR_DEFAULT_DATA)); InsertTailList (Link, &DefaultValueArray->Entry); @@ -1304,7 +1304,7 @@ GetSupportedLanguages ( // // Allocate the supported languages buffer. // - SupportedLanguages = AllocateZeroPool (LanguageSize); + SupportedLanguages = AllocateZeroPool(LanguageSize); if (SupportedLanguages == NULL) { // // Return NULL if allocation fails. @@ -1425,7 +1425,7 @@ InternalGetString ( // // Allocate a buffer for the return string // - String = AllocateZeroPool (StringSize); + String = AllocateZeroPool(StringSize); if (String == NULL) { goto Error; } @@ -1676,7 +1676,7 @@ GetVarStoreType ( } NameSize = AsciiStrSize ((CHAR8 *)IfrEfiVarStore->Name); - VarStoreName = AllocateZeroPool (NameSize * sizeof (CHAR16)); + VarStoreName = AllocateZeroPool(NameSize * sizeof (CHAR16)); if (VarStoreName == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Done; @@ -1687,7 +1687,7 @@ GetVarStoreType ( GenerateSubStr (L"NAME=", StrLen (VarStoreName) * sizeof (CHAR16), (VOID *) VarStoreName, 2, &NameStr); LengthString = StrLen (GuidStr); LengthString = LengthString + StrLen (NameStr) + 1; - TempStr = AllocateZeroPool (LengthString * sizeof (CHAR16)); + TempStr = AllocateZeroPool(LengthString * sizeof (CHAR16)); if (TempStr == NULL) { FreePool(GuidStr); FreePool(NameStr); @@ -1698,7 +1698,7 @@ GetVarStoreType ( StrCpyS (TempStr, LengthString, GuidStr); StrCatS (TempStr, LengthString, NameStr); if (ConfigHdr == NULL || StrnCmp (ConfigHdr, TempStr, StrLen (TempStr)) == 0) { - *EfiVarStore = (EFI_IFR_VARSTORE_EFI *) AllocateZeroPool (IfrOpHdr->Length); + *EfiVarStore = (EFI_IFR_VARSTORE_EFI *) AllocateZeroPool(IfrOpHdr->Length); if (*EfiVarStore == NULL) { FreePool(VarStoreName); FreePool(GuidStr); @@ -1806,7 +1806,7 @@ IsThisVarstore ( } LengthString = StrLen (GuidStr); LengthString = LengthString + StrLen (NameStr) + 1; - TempStr = AllocateZeroPool (LengthString * sizeof (CHAR16)); + TempStr = AllocateZeroPool(LengthString * sizeof (CHAR16)); if (TempStr == NULL) { goto Done; } @@ -1900,7 +1900,7 @@ IsThisPackageList ( IfrVarStore = (EFI_IFR_VARSTORE *) IfrOpHdr; NameSize = AsciiStrSize ((CHAR8 *)IfrVarStore->Name); - VarStoreName = AllocateZeroPool (NameSize * sizeof (CHAR16)); + VarStoreName = AllocateZeroPool(NameSize * sizeof (CHAR16)); if (VarStoreName == NULL) { goto Done; } @@ -1918,7 +1918,7 @@ IsThisPackageList ( case EFI_IFR_VARSTORE_EFI_OP: IfrEfiVarStore = (EFI_IFR_VARSTORE_EFI *) IfrOpHdr; NameSize = AsciiStrSize ((CHAR8 *)IfrEfiVarStore->Name); - VarStoreName = AllocateZeroPool (NameSize * sizeof (CHAR16)); + VarStoreName = AllocateZeroPool(NameSize * sizeof (CHAR16)); if (VarStoreName == NULL) { goto Done; } @@ -2055,7 +2055,7 @@ IsThisOpcodeRequired ( } } - BlockData = (IFR_BLOCK_DATA *) AllocateZeroPool (sizeof (IFR_BLOCK_DATA)); + BlockData = (IFR_BLOCK_DATA *) AllocateZeroPool(sizeof (IFR_BLOCK_DATA)); if (BlockData == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -2200,7 +2200,7 @@ ParseIfrData ( IfrVarStore = (EFI_IFR_VARSTORE *) IfrOpHdr; NameSize = AsciiStrSize ((CHAR8 *)IfrVarStore->Name); - VarStoreName = AllocateZeroPool (NameSize * sizeof (CHAR16)); + VarStoreName = AllocateZeroPool(NameSize * sizeof (CHAR16)); if (VarStoreName == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Done; @@ -2242,7 +2242,7 @@ ParseIfrData ( } NameSize = AsciiStrSize ((CHAR8 *)IfrEfiVarStore->Name); - VarStoreName = AllocateZeroPool (NameSize * sizeof (CHAR16)); + VarStoreName = AllocateZeroPool(NameSize * sizeof (CHAR16)); if (VarStoreName == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Done; @@ -2288,7 +2288,7 @@ ParseIfrData ( // // Add new the map between default id and default name. // - DefaultDataPtr = (IFR_DEFAULT_DATA *) AllocateZeroPool (sizeof (IFR_DEFAULT_DATA)); + DefaultDataPtr = (IFR_DEFAULT_DATA *) AllocateZeroPool(sizeof (IFR_DEFAULT_DATA)); if (DefaultDataPtr == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Done; @@ -3125,7 +3125,7 @@ GetBlockElement ( // // Init RequestBlockArray // - RequestBlockArray = (IFR_BLOCK_DATA *) AllocateZeroPool (sizeof (IFR_BLOCK_DATA)); + RequestBlockArray = (IFR_BLOCK_DATA *) AllocateZeroPool(sizeof (IFR_BLOCK_DATA)); if (RequestBlockArray == NULL) { goto Done; } @@ -3192,7 +3192,7 @@ GetBlockElement ( // // Set Block Data // - BlockData = (IFR_BLOCK_DATA *) AllocateZeroPool (sizeof (IFR_BLOCK_DATA)); + BlockData = (IFR_BLOCK_DATA *) AllocateZeroPool(sizeof (IFR_BLOCK_DATA)); if (BlockData == NULL) { goto Done; } @@ -3289,7 +3289,7 @@ GetNameElement ( // // Init RequestBlockArray // - RequestBlockArray = (IFR_BLOCK_DATA *) AllocateZeroPool (sizeof (IFR_BLOCK_DATA)); + RequestBlockArray = (IFR_BLOCK_DATA *) AllocateZeroPool(sizeof (IFR_BLOCK_DATA)); if (RequestBlockArray == NULL) { goto Done; } @@ -3323,7 +3323,7 @@ GetNameElement ( // // Set Block Data // - BlockData = (IFR_BLOCK_DATA *) AllocateZeroPool (sizeof (IFR_BLOCK_DATA)); + BlockData = (IFR_BLOCK_DATA *) AllocateZeroPool(sizeof (IFR_BLOCK_DATA)); if (BlockData == NULL) { goto Done; } @@ -3447,7 +3447,7 @@ GenerateConfigRequest ( // // Allocate buffer for the entire // - FullConfigRequest = AllocateZeroPool (Length * sizeof (CHAR16)); + FullConfigRequest = AllocateZeroPool(Length * sizeof (CHAR16)); if (FullConfigRequest == NULL) { *Status = EFI_OUT_OF_RESOURCES; return FALSE; @@ -3551,7 +3551,7 @@ GenerateHdr ( Length += 1; } - *ConfigHdr = AllocateZeroPool (Length * sizeof (CHAR16)); + *ConfigHdr = AllocateZeroPool(Length * sizeof (CHAR16)); if (*ConfigHdr == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Done; @@ -3881,7 +3881,7 @@ GenerateAltConfigResp ( // // Allocate buffer for the entire // - *DefaultAltCfgResp = AllocateZeroPool (Length * sizeof (CHAR16)); + *DefaultAltCfgResp = AllocateZeroPool(Length * sizeof (CHAR16)); if (*DefaultAltCfgResp == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -3945,7 +3945,7 @@ GenerateAltConfigResp ( // if (BlockData->OpCode == EFI_IFR_STRING_OP){ DefaultString = InternalGetString(HiiHandle, DefaultValueData->Value.string); - TmpBuffer = AllocateZeroPool (Width); + TmpBuffer = AllocateZeroPool(Width); ASSERT (TmpBuffer != NULL); if (DefaultString != NULL) { StrSize = StrLen(DefaultString)* sizeof (CHAR16); @@ -4133,7 +4133,7 @@ GetFullStringFromHiiFormPackages ( // // Initialize DefaultIdArray to store the map between DeaultId and DefaultName // - DefaultIdArray = (IFR_DEFAULT_DATA *) AllocateZeroPool (sizeof (IFR_DEFAULT_DATA)); + DefaultIdArray = (IFR_DEFAULT_DATA *) AllocateZeroPool(sizeof (IFR_DEFAULT_DATA)); if (DefaultIdArray == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Done; @@ -4143,7 +4143,7 @@ GetFullStringFromHiiFormPackages ( // // Initialize VarStorageData to store the var store Block and Default value information. // - VarStorageData = (IFR_VARSTORAGE_DATA *) AllocateZeroPool (sizeof (IFR_VARSTORAGE_DATA)); + VarStorageData = (IFR_VARSTORAGE_DATA *) AllocateZeroPool(sizeof (IFR_VARSTORAGE_DATA)); if (VarStorageData == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Done; @@ -4342,7 +4342,7 @@ GetConfigRespFromEfiVarStore ( *AccessProgress = Request; NameSize = AsciiStrSize ((CHAR8 *)EfiVarStoreInfo->Name); - VarStoreName = AllocateZeroPool (NameSize * sizeof (CHAR16)); + VarStoreName = AllocateZeroPool(NameSize * sizeof (CHAR16)); if (VarStoreName == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Done; @@ -4355,7 +4355,7 @@ GetConfigRespFromEfiVarStore ( goto Done; } - VarStore = AllocateZeroPool (BufferSize); + VarStore = AllocateZeroPool(BufferSize); ASSERT (VarStore != NULL); Status = gRT->GetVariable (VarStoreName, &EfiVarStoreInfo->Guid, NULL, &BufferSize, VarStore); if (EFI_ERROR(Status)) { @@ -4420,7 +4420,7 @@ RouteConfigRespForEfiVarStore ( *Result = RequestResp; NameSize = AsciiStrSize ((CHAR8 *)EfiVarStoreInfo->Name); - VarStoreName = AllocateZeroPool (NameSize * sizeof (CHAR16)); + VarStoreName = AllocateZeroPool(NameSize * sizeof (CHAR16)); if (VarStoreName == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Done; @@ -4434,7 +4434,7 @@ RouteConfigRespForEfiVarStore ( } BlockSize = BufferSize; - VarStore = AllocateZeroPool (BufferSize); + VarStore = AllocateZeroPool(BufferSize); ASSERT (VarStore != NULL); Status = gRT->GetVariable (VarStoreName, &EfiVarStoreInfo->Guid, NULL, &BufferSize, VarStore); if (EFI_ERROR(Status)) { @@ -4724,7 +4724,7 @@ HiiConfigRoutingExtractConfig ( // Allocate a fix length of memory to store Results. Reallocate memory for // Results if this fix length is insufficient. // - *Results = (EFI_STRING) AllocateZeroPool (MAX_STRING_LENGTH); + *Results = (EFI_STRING) AllocateZeroPool(MAX_STRING_LENGTH); if (*Results == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -5076,7 +5076,7 @@ HiiConfigRoutingExportConfig ( // Allocate a fix length of memory to store Results. Reallocate memory for // Results if this fix length is insufficient. // - *Results = (EFI_STRING) AllocateZeroPool (MAX_STRING_LENGTH); + *Results = (EFI_STRING) AllocateZeroPool(MAX_STRING_LENGTH); if (*Results == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -5522,7 +5522,7 @@ HiiBlockToConfig ( // Allocate a fix length of memory to store Results. Reallocate memory for // Results if this fix length is insufficient. // - *Config = (EFI_STRING) AllocateZeroPool (MAX_STRING_LENGTH); + *Config = (EFI_STRING) AllocateZeroPool(MAX_STRING_LENGTH); if (*Config == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -5636,7 +5636,7 @@ HiiBlockToConfig ( goto Exit; } - Value = (UINT8 *) AllocateZeroPool (Width); + Value = (UINT8 *) AllocateZeroPool(Width); if (Value == NULL) { *Progress = ConfigRequest; Status = EFI_OUT_OF_RESOURCES; @@ -5646,7 +5646,7 @@ HiiBlockToConfig ( CopyMem (Value, (UINT8 *) Block + Offset, Width); Length = Width * 2 + 1; - ValueStr = (EFI_STRING) AllocateZeroPool (Length * sizeof (CHAR16)); + ValueStr = (EFI_STRING) AllocateZeroPool(Length * sizeof (CHAR16)); if (ValueStr == NULL) { *Progress = ConfigRequest; Status = EFI_OUT_OF_RESOURCES; @@ -5673,7 +5673,7 @@ HiiBlockToConfig ( // Build a ConfigElement // Length += StringPtr - TmpPtr + 1 + StrLen (L"VALUE="); - ConfigElement = (EFI_STRING) AllocateZeroPool (Length * sizeof (CHAR16)); + ConfigElement = (EFI_STRING) AllocateZeroPool(Length * sizeof (CHAR16)); if (ConfigElement == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Exit; @@ -6197,7 +6197,7 @@ Exit: // Copy the and // Length = HdrEnd - HdrStart + StrLen (Result) + 1; - *AltCfgResp = AllocateZeroPool (Length * sizeof (CHAR16)); + *AltCfgResp = AllocateZeroPool(Length * sizeof (CHAR16)); if (*AltCfgResp == NULL) { Status = EFI_OUT_OF_RESOURCES; } else { diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c b/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c index 8a360a804..d5f8c5a67 100644 --- a/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c @@ -53,13 +53,13 @@ GenerateHiiDatabaseRecord ( return EFI_INVALID_PARAMETER; } - DatabaseRecord = (HII_DATABASE_RECORD *) AllocateZeroPool (sizeof (HII_DATABASE_RECORD)); + DatabaseRecord = (HII_DATABASE_RECORD *) AllocateZeroPool(sizeof (HII_DATABASE_RECORD)); if (DatabaseRecord == NULL) { return EFI_OUT_OF_RESOURCES; } DatabaseRecord->Signature = HII_DATABASE_RECORD_SIGNATURE; - DatabaseRecord->PackageList = AllocateZeroPool (sizeof (HII_DATABASE_PACKAGE_LIST_INSTANCE)); + DatabaseRecord->PackageList = AllocateZeroPool(sizeof (HII_DATABASE_PACKAGE_LIST_INSTANCE)); if (DatabaseRecord->PackageList == NULL) { FreePool(DatabaseRecord); return EFI_OUT_OF_RESOURCES; @@ -79,7 +79,7 @@ GenerateHiiDatabaseRecord ( // // Create a new hii handle // - HiiHandle = (HII_HANDLE *) AllocateZeroPool (sizeof (HII_HANDLE)); + HiiHandle = (HII_HANDLE *) AllocateZeroPool(sizeof (HII_HANDLE)); if (HiiHandle == NULL) { FreePool(DatabaseRecord->PackageList); FreePool(DatabaseRecord); @@ -200,7 +200,7 @@ InvokeRegisteredFunction ( case EFI_HII_PACKAGE_FORMS: BufferSize = ((HII_IFR_PACKAGE_INSTANCE *) PackageInstance)->FormPkgHdr.Length; - Buffer = (UINT8 *) AllocateZeroPool (BufferSize); + Buffer = (UINT8 *) AllocateZeroPool(BufferSize); ASSERT (Buffer != NULL); CopyMem ( Buffer, @@ -222,7 +222,7 @@ InvokeRegisteredFunction ( case EFI_HII_PACKAGE_STRINGS: BufferSize = ((HII_STRING_PACKAGE_INSTANCE *) PackageInstance)->StringPkgHdr->Header.Length; HeaderSize = ((HII_STRING_PACKAGE_INSTANCE *) PackageInstance)->StringPkgHdr->HdrSize; - Buffer = (UINT8 *) AllocateZeroPool (BufferSize); + Buffer = (UINT8 *) AllocateZeroPool(BufferSize); ASSERT (Buffer != NULL); CopyMem ( Buffer, @@ -240,7 +240,7 @@ InvokeRegisteredFunction ( case EFI_HII_PACKAGE_FONTS: BufferSize = ((HII_FONT_PACKAGE_INSTANCE *) PackageInstance)->FontPkgHdr->Header.Length; HeaderSize = ((HII_FONT_PACKAGE_INSTANCE *) PackageInstance)->FontPkgHdr->HdrSize; - Buffer = (UINT8 *) AllocateZeroPool (BufferSize); + Buffer = (UINT8 *) AllocateZeroPool(BufferSize); ASSERT (Buffer != NULL); CopyMem ( Buffer, @@ -258,7 +258,7 @@ InvokeRegisteredFunction ( case EFI_HII_PACKAGE_IMAGES: BufferSize = ((HII_IMAGE_PACKAGE_INSTANCE *) PackageInstance)->ImagePkgHdr.Header.Length; HeaderSize = sizeof (EFI_HII_IMAGE_PACKAGE_HDR); - Buffer = (UINT8 *) AllocateZeroPool (BufferSize); + Buffer = (UINT8 *) AllocateZeroPool(BufferSize); ASSERT (Buffer != NULL); CopyMem ( @@ -300,7 +300,7 @@ InvokeRegisteredFunction ( case EFI_HII_PACKAGE_SIMPLE_FONTS: BufferSize = ((HII_SIMPLE_FONT_PACKAGE_INSTANCE *) PackageInstance)->SimpleFontPkgHdr->Header.Length; - Buffer = (UINT8 *) AllocateZeroPool (BufferSize); + Buffer = (UINT8 *) AllocateZeroPool(BufferSize); ASSERT (Buffer != NULL); CopyMem ( Buffer, @@ -388,11 +388,11 @@ InsertGuidPackage ( // // Create a GUID package node // - GuidPackage = (HII_GUID_PACKAGE_INSTANCE *) AllocateZeroPool (sizeof (HII_GUID_PACKAGE_INSTANCE)); + GuidPackage = (HII_GUID_PACKAGE_INSTANCE *) AllocateZeroPool(sizeof (HII_GUID_PACKAGE_INSTANCE)); if (GuidPackage == NULL) { return EFI_OUT_OF_RESOURCES; } - GuidPackage->GuidPkg = (UINT8 *) AllocateZeroPool (PackageHeader.Length); + GuidPackage->GuidPkg = (UINT8 *) AllocateZeroPool(PackageHeader.Length); if (GuidPackage->GuidPkg == NULL) { FreePool(GuidPackage); return EFI_OUT_OF_RESOURCES; @@ -1098,12 +1098,12 @@ InsertFormPackage ( // // Create a Form package node // - FormPackage = (HII_IFR_PACKAGE_INSTANCE *) AllocateZeroPool (sizeof (HII_IFR_PACKAGE_INSTANCE)); + FormPackage = (HII_IFR_PACKAGE_INSTANCE *) AllocateZeroPool(sizeof (HII_IFR_PACKAGE_INSTANCE)); if (FormPackage == NULL) { return EFI_OUT_OF_RESOURCES; } - FormPackage->IfrData = (UINT8 *) AllocateZeroPool (PackageHeader.Length - sizeof (EFI_HII_PACKAGE_HEADER)); + FormPackage->IfrData = (UINT8 *) AllocateZeroPool(PackageHeader.Length - sizeof (EFI_HII_PACKAGE_HEADER)); if (FormPackage->IfrData == NULL) { FreePool(FormPackage); return EFI_OUT_OF_RESOURCES; @@ -1340,7 +1340,7 @@ InsertStringPackage ( // since the stringid will be duplicate if so. Check it to avoid this potential issue. // LanguageSize = HeaderSize - sizeof (EFI_HII_STRING_PACKAGE_HDR) + sizeof (CHAR8); - Language = (CHAR8 *) AllocateZeroPool (LanguageSize); + Language = (CHAR8 *) AllocateZeroPool(LanguageSize); if (Language == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -1357,19 +1357,19 @@ InsertStringPackage ( // // Create a String package node // - StringPackage = (HII_STRING_PACKAGE_INSTANCE *) AllocateZeroPool (sizeof (HII_STRING_PACKAGE_INSTANCE)); + StringPackage = (HII_STRING_PACKAGE_INSTANCE *) AllocateZeroPool(sizeof (HII_STRING_PACKAGE_INSTANCE)); if (StringPackage == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Error; } - StringPackage->StringPkgHdr = (EFI_HII_STRING_PACKAGE_HDR *) AllocateZeroPool (HeaderSize); + StringPackage->StringPkgHdr = (EFI_HII_STRING_PACKAGE_HDR *) AllocateZeroPool(HeaderSize); if (StringPackage->StringPkgHdr == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Error; } - StringPackage->StringBlock = (UINT8 *) AllocateZeroPool (PackageHeader.Length - HeaderSize); + StringPackage->StringBlock = (UINT8 *) AllocateZeroPool(PackageHeader.Length - HeaderSize); if (StringPackage->StringBlock == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Error; @@ -1475,7 +1475,7 @@ AdjustStringPackage ( SkipCount = (UINT16) (MaxStringId - StringPackage->MaxStringId); Skip2BlockSize = (UINT32) sizeof (EFI_HII_SIBT_SKIP2_BLOCK); - StringBlock = (UINT8 *) AllocateZeroPool (OldBlockSize + Skip2BlockSize); + StringBlock = (UINT8 *) AllocateZeroPool(OldBlockSize + Skip2BlockSize); if (StringBlock == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -1713,7 +1713,7 @@ InsertFontPackage ( // database. EFI_FONT_INFO (FontName, FontSize, FontStyle) describes font's // attributes and identify a font uniquely. // - FontPkgHdr = (EFI_HII_FONT_PACKAGE_HDR *) AllocateZeroPool (HeaderSize); + FontPkgHdr = (EFI_HII_FONT_PACKAGE_HDR *) AllocateZeroPool(HeaderSize); if (FontPkgHdr == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Error; @@ -1721,7 +1721,7 @@ InsertFontPackage ( CopyMem (FontPkgHdr, PackageHdr, HeaderSize); FontInfoSize = sizeof (EFI_FONT_INFO) + HeaderSize - sizeof (EFI_HII_FONT_PACKAGE_HDR); - FontInfo = (EFI_FONT_INFO *) AllocateZeroPool (FontInfoSize); + FontInfo = (EFI_FONT_INFO *) AllocateZeroPool(FontInfoSize); if (FontInfo == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Error; @@ -1738,7 +1738,7 @@ InsertFontPackage ( // // Create a Font package node // - FontPackage = (HII_FONT_PACKAGE_INSTANCE *) AllocateZeroPool (sizeof (HII_FONT_PACKAGE_INSTANCE)); + FontPackage = (HII_FONT_PACKAGE_INSTANCE *) AllocateZeroPool(sizeof (HII_FONT_PACKAGE_INSTANCE)); if (FontPackage == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Error; @@ -1747,7 +1747,7 @@ InsertFontPackage ( FontPackage->FontPkgHdr = FontPkgHdr; InitializeListHead (&FontPackage->GlyphInfoList); - FontPackage->GlyphBlock = (UINT8 *) AllocateZeroPool (PackageHeader.Length - HeaderSize); + FontPackage->GlyphBlock = (UINT8 *) AllocateZeroPool(PackageHeader.Length - HeaderSize); if (FontPackage->GlyphBlock == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Error; @@ -1766,7 +1766,7 @@ InsertFontPackage ( // This font package describes an unique EFI_FONT_INFO. Backup it in global // font info list. // - GlobalFont = (HII_GLOBAL_FONT_INFO *) AllocateZeroPool (sizeof (HII_GLOBAL_FONT_INFO)); + GlobalFont = (HII_GLOBAL_FONT_INFO *) AllocateZeroPool(sizeof (HII_GLOBAL_FONT_INFO)); if (GlobalFont == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Error; @@ -2033,7 +2033,7 @@ InsertImagePackage ( // // Create a Image package node // - ImagePackage = (HII_IMAGE_PACKAGE_INSTANCE *) AllocateZeroPool (sizeof (HII_IMAGE_PACKAGE_INSTANCE)); + ImagePackage = (HII_IMAGE_PACKAGE_INSTANCE *) AllocateZeroPool(sizeof (HII_IMAGE_PACKAGE_INSTANCE)); if (ImagePackage == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -2063,7 +2063,7 @@ InsertImagePackage ( PaletteInfo = (EFI_HII_IMAGE_PALETTE_INFO *) ((UINT8 *) PaletteInfo + CurrentSize); } - ImagePackage->PaletteBlock = (UINT8 *) AllocateZeroPool (PaletteSize); + ImagePackage->PaletteBlock = (UINT8 *) AllocateZeroPool(PaletteSize); if (ImagePackage->PaletteBlock == NULL) { FreePool(ImagePackage); return EFI_OUT_OF_RESOURCES; @@ -2083,7 +2083,7 @@ InsertImagePackage ( if (ImageInfoOffset != 0) { ImageSize = ImagePackage->ImagePkgHdr.Header.Length - sizeof (EFI_HII_IMAGE_PACKAGE_HDR) - PaletteSize; - ImagePackage->ImageBlock = AllocateZeroPool (ImageSize); + ImagePackage->ImageBlock = AllocateZeroPool(ImageSize); if (ImagePackage->ImageBlock == NULL) { FreePool(ImagePackage->PaletteBlock); FreePool(ImagePackage); @@ -2294,7 +2294,7 @@ InsertSimpleFontPackage ( // // Create a Simple Font package node // - SimpleFontPackage = AllocateZeroPool (sizeof (HII_SIMPLE_FONT_PACKAGE_INSTANCE)); + SimpleFontPackage = AllocateZeroPool(sizeof (HII_SIMPLE_FONT_PACKAGE_INSTANCE)); if (SimpleFontPackage == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Error; @@ -2306,7 +2306,7 @@ InsertSimpleFontPackage ( // CopyMem (&Header, PackageHdr, sizeof (EFI_HII_PACKAGE_HEADER)); - SimpleFontPackage->SimpleFontPkgHdr = AllocateZeroPool (Header.Length); + SimpleFontPackage->SimpleFontPkgHdr = AllocateZeroPool(Header.Length); if (SimpleFontPackage->SimpleFontPkgHdr == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Error; @@ -2503,7 +2503,7 @@ InsertDevicePathPackage ( } PackageLength = (UINT32) GetDevicePathSize (DevicePath) + sizeof (EFI_HII_PACKAGE_HEADER); - PackageList->DevicePathPkg = (UINT8 *) AllocateZeroPool (PackageLength); + PackageList->DevicePathPkg = (UINT8 *) AllocateZeroPool(PackageLength); if (PackageList->DevicePathPkg == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -2747,14 +2747,14 @@ InsertKeyboardLayoutPackage ( // // Create a Keyboard Layout package node // - KeyboardLayoutPackage = AllocateZeroPool (sizeof (HII_KEYBOARD_LAYOUT_PACKAGE_INSTANCE)); + KeyboardLayoutPackage = AllocateZeroPool(sizeof (HII_KEYBOARD_LAYOUT_PACKAGE_INSTANCE)); if (KeyboardLayoutPackage == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Error; } KeyboardLayoutPackage->Signature = HII_KB_LAYOUT_PACKAGE_SIGNATURE; - KeyboardLayoutPackage->KeyboardPkg = (UINT8 *) AllocateZeroPool (PackageHeader.Length); + KeyboardLayoutPackage->KeyboardPkg = (UINT8 *) AllocateZeroPool(PackageHeader.Length); if (KeyboardLayoutPackage->KeyboardPkg == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Error; @@ -4177,7 +4177,7 @@ HiiRegisterPackageNotify ( // // Allocate a notification node // - Notify = (HII_DATABASE_NOTIFY *) AllocateZeroPool (sizeof (HII_DATABASE_NOTIFY)); + Notify = (HII_DATABASE_NOTIFY *) AllocateZeroPool(sizeof (HII_DATABASE_NOTIFY)); if (Notify == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -4546,7 +4546,7 @@ HiiSetKeyboardLayout ( return Status; } - KeyboardLayout = (EFI_HII_KEYBOARD_LAYOUT *) AllocateZeroPool (KeyboardLayoutLength); + KeyboardLayout = (EFI_HII_KEYBOARD_LAYOUT *) AllocateZeroPool(KeyboardLayoutLength); ASSERT (KeyboardLayout != NULL); Status = HiiGetKeyboardLayout (This, KeyGuid, &KeyboardLayoutLength, KeyboardLayout); ASSERT_EFI_ERROR(Status); diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c b/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c index d07504c1c..87bc1bfdf 100644 --- a/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c @@ -59,7 +59,7 @@ NewCell ( ASSERT (Cell != NULL && GlyphInfoList != NULL); - GlyphInfo = (HII_GLYPH_INFO *) AllocateZeroPool (sizeof (HII_GLYPH_INFO)); + GlyphInfo = (HII_GLYPH_INFO *) AllocateZeroPool(sizeof (HII_GLYPH_INFO)); if (GlyphInfo == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -212,7 +212,7 @@ GetGlyphBuffer ( for (Index = 0; Index < SimpleFont->SimpleFontPkgHdr->NumberOfNarrowGlyphs; Index++) { CopyMem (&Narrow, NarrowPtr + Index,sizeof (EFI_NARROW_GLYPH)); if (Narrow.UnicodeWeight == Char) { - *GlyphBuffer = (UINT8 *) AllocateZeroPool (EFI_GLYPH_HEIGHT); + *GlyphBuffer = (UINT8 *) AllocateZeroPool(EFI_GLYPH_HEIGHT); if (*GlyphBuffer == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -233,7 +233,7 @@ GetGlyphBuffer ( for (Index = 0; Index < SimpleFont->SimpleFontPkgHdr->NumberOfWideGlyphs; Index++) { CopyMem (&Wide, WidePtr + Index, sizeof (EFI_WIDE_GLYPH)); if (Wide.UnicodeWeight == Char) { - *GlyphBuffer = (UINT8 *) AllocateZeroPool (EFI_GLYPH_HEIGHT * 2); + *GlyphBuffer = (UINT8 *) AllocateZeroPool(EFI_GLYPH_HEIGHT * 2); if (*GlyphBuffer == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -617,7 +617,7 @@ WriteOutputParam ( } if (GlyphBuffer != NULL && BufferLen > 0) { - *GlyphBuffer = (UINT8 *) AllocateZeroPool (BufferLen); + *GlyphBuffer = (UINT8 *) AllocateZeroPool(BufferLen); if (*GlyphBuffer == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -945,7 +945,7 @@ SaveFontName ( NameSize = StrSize (FontName); FontInfoLen = sizeof (EFI_FONT_INFO) - sizeof (CHAR16) + NameSize; - *FontInfo = (EFI_FONT_INFO *) AllocateZeroPool (FontInfoLen); + *FontInfo = (EFI_FONT_INFO *) AllocateZeroPool(FontInfoLen); if (*FontInfo == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -993,7 +993,7 @@ GetSystemFont ( // NameSize = StrSize (L"sysdefault"); InfoSize = sizeof (EFI_FONT_DISPLAY_INFO) - sizeof (CHAR16) + NameSize; - Info = (EFI_FONT_DISPLAY_INFO *) AllocateZeroPool (InfoSize); + Info = (EFI_FONT_DISPLAY_INFO *) AllocateZeroPool(InfoSize); if (Info == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -1659,13 +1659,13 @@ HiiStringToImage ( // // Create a new bitmap and draw the string onto this image. // - Image = AllocateZeroPool (sizeof (EFI_IMAGE_OUTPUT)); + Image = AllocateZeroPool(sizeof (EFI_IMAGE_OUTPUT)); if (Image == NULL) { return EFI_OUT_OF_RESOURCES; } Image->Width = 800; Image->Height = 600; - Image->Image.Bitmap = AllocateZeroPool (Image->Width * Image->Height *sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)); + Image->Image.Bitmap = AllocateZeroPool(Image->Width * Image->Height *sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)); if (Image->Image.Bitmap == NULL) { FreePool(Image); return EFI_OUT_OF_RESOURCES; @@ -1679,11 +1679,11 @@ HiiStringToImage ( } StrLength = StrLen(String); - GlyphBuf = (UINT8 **) AllocateZeroPool (StrLength * sizeof (UINT8 *)); + GlyphBuf = (UINT8 **) AllocateZeroPool(StrLength * sizeof (UINT8 *)); ASSERT (GlyphBuf != NULL); - Cell = (EFI_HII_GLYPH_INFO *) AllocateZeroPool (StrLength * sizeof (EFI_HII_GLYPH_INFO)); + Cell = (EFI_HII_GLYPH_INFO *) AllocateZeroPool(StrLength * sizeof (EFI_HII_GLYPH_INFO)); ASSERT (Cell != NULL); - Attributes = (UINT8 *) AllocateZeroPool (StrLength * sizeof (UINT8)); + Attributes = (UINT8 *) AllocateZeroPool(StrLength * sizeof (UINT8)); ASSERT (Attributes != NULL); RowInfo = NULL; @@ -1759,7 +1759,7 @@ HiiStringToImage ( // without line-break opportunity. // if ((Flags & EFI_HII_IGNORE_LINE_BREAK) == EFI_HII_IGNORE_LINE_BREAK) { - StringIn = AllocateZeroPool (StrSize (StringPtr)); + StringIn = AllocateZeroPool(StrSize (StringPtr)); if (StringIn == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Exit; @@ -1779,7 +1779,7 @@ HiiStringToImage ( // If EFI_HII_IGNORE_IF_NO_GLYPH is set, then characters which have no glyphs // are not drawn. Otherwise they are replaced with Unicode character 0xFFFD. // - StringIn2 = AllocateZeroPool (StrSize (StringPtr)); + StringIn2 = AllocateZeroPool(StrSize (StringPtr)); if (StringIn2 == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Exit; @@ -1849,7 +1849,7 @@ HiiStringToImage ( MaxRowNum++; } - RowInfo = (EFI_HII_ROW_INFO *) AllocateZeroPool (MaxRowNum * sizeof (EFI_HII_ROW_INFO)); + RowInfo = (EFI_HII_ROW_INFO *) AllocateZeroPool(MaxRowNum * sizeof (EFI_HII_ROW_INFO)); if (RowInfo == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Exit; @@ -2189,7 +2189,7 @@ NextLine: RowInfoSize = RowIndex * sizeof (EFI_HII_ROW_INFO); if (RowInfoArray != NULL) { if (RowInfoSize > 0) { - *RowInfoArray = AllocateZeroPool (RowInfoSize); + *RowInfoArray = AllocateZeroPool(RowInfoSize); if (*RowInfoArray == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Exit; @@ -2405,7 +2405,7 @@ HiiStringIdToImage ( } StringSize = MAX_STRING_LENGTH; - String = (EFI_STRING) AllocateZeroPool (StringSize); + String = (EFI_STRING) AllocateZeroPool(StringSize); if (String == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Exit; @@ -2422,7 +2422,7 @@ HiiStringIdToImage ( ); if (Status == EFI_BUFFER_TOO_SMALL) { FreePool(String); - String = (EFI_STRING) AllocateZeroPool (StringSize); + String = (EFI_STRING) AllocateZeroPool(StringSize); if (String == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Exit; @@ -2450,7 +2450,7 @@ HiiStringIdToImage ( if (StringFontInfo != NULL && IsSystemFontInfo (Private, (EFI_FONT_DISPLAY_INFO *) StringInfo, NULL, NULL)) { NameSize = StrSize (StringFontInfo->FontName); FontLen = sizeof (EFI_FONT_DISPLAY_INFO) - sizeof (CHAR16) + NameSize; - NewStringInfo = AllocateZeroPool (FontLen); + NewStringInfo = AllocateZeroPool(FontLen); if (NewStringInfo == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Exit; @@ -2586,7 +2586,7 @@ HiiGetGlyph ( // Find out a EFI_FONT_DISPLAY_INFO which could display the character in // the specified color and font. // - String = (EFI_STRING) AllocateZeroPool (sizeof (CHAR16) * 2); + String = (EFI_STRING) AllocateZeroPool(sizeof (CHAR16) * 2); if (String == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Exit; @@ -2613,7 +2613,7 @@ HiiGetGlyph ( goto Exit; } - Image = (EFI_IMAGE_OUTPUT *) AllocateZeroPool (sizeof (EFI_IMAGE_OUTPUT)); + Image = (EFI_IMAGE_OUTPUT *) AllocateZeroPool(sizeof (EFI_IMAGE_OUTPUT)); if (Image == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Exit; @@ -2622,7 +2622,7 @@ HiiGetGlyph ( Image->Height = Cell.Height; if (Image->Width * Image->Height > 0) { - Image->Image.Bitmap = AllocateZeroPool (Image->Width * Image->Height * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)); + Image->Image.Bitmap = AllocateZeroPool(Image->Width * Image->Height * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)); if (Image->Image.Bitmap == NULL) { FreePool(Image); Status = EFI_OUT_OF_RESOURCES; @@ -2867,7 +2867,7 @@ HiiGetFontInfo ( // if (StringInfoOut != NULL) { StringInfoOutLen = sizeof (EFI_FONT_DISPLAY_INFO) - sizeof (EFI_FONT_INFO) + GlobalFont->FontInfoSize; - *StringInfoOut = (EFI_FONT_DISPLAY_INFO *) AllocateZeroPool (StringInfoOutLen); + *StringInfoOut = (EFI_FONT_DISPLAY_INFO *) AllocateZeroPool(StringInfoOutLen); if (*StringInfoOut == NULL) { Status = EFI_OUT_OF_RESOURCES; LocalFontHandle = NULL; diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/Image.c b/MdeModulePkg/Universal/HiiDatabaseDxe/Image.c index 91e8d6770..62c9c5485 100644 --- a/MdeModulePkg/Universal/HiiDatabaseDxe/Image.c +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/Image.c @@ -266,7 +266,7 @@ Output1bitPixel ( PaletteSize = 0; CopyMem (&PaletteSize, PaletteInfo, sizeof (UINT16)); PaletteSize += sizeof (UINT16); - Palette = AllocateZeroPool (PaletteSize); + Palette = AllocateZeroPool(PaletteSize); ASSERT (Palette != NULL); if (Palette == NULL) { return; @@ -355,7 +355,7 @@ Output4bitPixel ( PaletteSize = 0; CopyMem (&PaletteSize, PaletteInfo, sizeof (UINT16)); PaletteSize += sizeof (UINT16); - Palette = AllocateZeroPool (PaletteSize); + Palette = AllocateZeroPool(PaletteSize); ASSERT (Palette != NULL); if (Palette == NULL) { return; @@ -433,7 +433,7 @@ Output8bitPixel ( PaletteSize = 0; CopyMem (&PaletteSize, PaletteInfo, sizeof (UINT16)); PaletteSize += sizeof (UINT16); - Palette = AllocateZeroPool (PaletteSize); + Palette = AllocateZeroPool(PaletteSize); ASSERT (Palette != NULL); if (Palette == NULL) { return; @@ -730,7 +730,7 @@ HiiNewImage ( // The specified package list does not contain image package. // Create one to add this image block. // - ImagePackage = (HII_IMAGE_PACKAGE_INSTANCE *) AllocateZeroPool (sizeof (HII_IMAGE_PACKAGE_INSTANCE)); + ImagePackage = (HII_IMAGE_PACKAGE_INSTANCE *) AllocateZeroPool(sizeof (HII_IMAGE_PACKAGE_INSTANCE)); if (ImagePackage == NULL) { EfiReleaseLock (&mHiiDatabaseLock); return EFI_OUT_OF_RESOURCES; @@ -758,7 +758,7 @@ HiiNewImage ( // Fill in image blocks. // ImagePackage->ImageBlockSize = NewBlockSize + sizeof (EFI_HII_IIBT_END_BLOCK); - ImagePackage->ImageBlock = AllocateZeroPool (NewBlockSize + sizeof (EFI_HII_IIBT_END_BLOCK)); + ImagePackage->ImageBlock = AllocateZeroPool(NewBlockSize + sizeof (EFI_HII_IIBT_END_BLOCK)); if (ImagePackage->ImageBlock == NULL) { FreePool(ImagePackage); EfiReleaseLock (&mHiiDatabaseLock); @@ -932,7 +932,7 @@ IGetImage ( return EFI_OUT_OF_RESOURCES; } ImageLength *= sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL); - Image->Bitmap = AllocateZeroPool (ImageLength); + Image->Bitmap = AllocateZeroPool(ImageLength); if (Image->Bitmap == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -987,7 +987,7 @@ IGetImage ( return EFI_OUT_OF_RESOURCES; } ImageLength *= sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL); - Image->Bitmap = AllocateZeroPool (ImageLength); + Image->Bitmap = AllocateZeroPool(ImageLength); if (Image->Bitmap == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -1178,7 +1178,7 @@ HiiSetImage ( // // Adjust the image package to remove the original block firstly then add the new block. // - ImageBlocks = AllocateZeroPool (ImagePackage->ImageBlockSize + NewBlockSize - OldBlockSize); + ImageBlocks = AllocateZeroPool(ImagePackage->ImageBlockSize + NewBlockSize - OldBlockSize); if (ImageBlocks == NULL) { EfiReleaseLock (&mHiiDatabaseLock); return EFI_OUT_OF_RESOURCES; @@ -1359,7 +1359,7 @@ HiiDrawImage ( return EFI_OUT_OF_RESOURCES; } BufferLen *= sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL); - BltBuffer = AllocateZeroPool (BufferLen); + BltBuffer = AllocateZeroPool(BufferLen); if (BltBuffer == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -1441,12 +1441,12 @@ HiiDrawImage ( return EFI_OUT_OF_RESOURCES; } BufferLen *= sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL); - BltBuffer = AllocateZeroPool (BufferLen); + BltBuffer = AllocateZeroPool(BufferLen); if (BltBuffer == NULL) { return EFI_OUT_OF_RESOURCES; } - ImageOut = (EFI_IMAGE_OUTPUT *) AllocateZeroPool (sizeof (EFI_IMAGE_OUTPUT)); + ImageOut = (EFI_IMAGE_OUTPUT *) AllocateZeroPool(sizeof (EFI_IMAGE_OUTPUT)); if (ImageOut == NULL) { FreePool(BltBuffer); return EFI_OUT_OF_RESOURCES; diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/String.c b/MdeModulePkg/Universal/HiiDatabaseDxe/String.c index cf9532edc..8cc2a6c18 100644 --- a/MdeModulePkg/Universal/HiiDatabaseDxe/String.c +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/String.c @@ -76,7 +76,7 @@ ReferFontInfoLocally ( // GlobalEntry points to a HII_GLOBAL_FONT_INFO which identifies // EFI_FONT_INFO uniquely in whole hii database. // - LocalFont = (HII_FONT_INFO *) AllocateZeroPool (sizeof (HII_FONT_INFO)); + LocalFont = (HII_FONT_INFO *) AllocateZeroPool(sizeof (HII_FONT_INFO)); ASSERT (LocalFont != NULL); LocalFont->Signature = HII_FONT_INFO_SIGNATURE; @@ -124,7 +124,7 @@ ConvertToUnicodeText ( return EFI_BUFFER_TOO_SMALL; } - for (Index = 0; Index < AsciiStrLen (StringSrc); Index++) { + for (Index = 0; Index < AsciiStrLen(StringSrc); Index++) { StringDest[Index] = (CHAR16) StringSrc[Index]; } @@ -214,7 +214,7 @@ GetStringFontInfo ( FontInfo = CR (Link, HII_FONT_INFO, Entry, HII_FONT_INFO_SIGNATURE); if (FontInfo->FontId == FontId) { GlobalFont = CR (FontInfo->GlobalEntry, HII_GLOBAL_FONT_INFO, Entry, HII_GLOBAL_FONT_INFO_SIGNATURE); - *StringFontInfo = (EFI_FONT_INFO *) AllocateZeroPool (GlobalFont->FontInfoSize); + *StringFontInfo = (EFI_FONT_INFO *) AllocateZeroPool(GlobalFont->FontInfoSize); if (*StringFontInfo == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -498,7 +498,7 @@ FindStringBlock ( GetUnicodeStringTextOrSize (NULL, BlockHdr, &StringSize); FontInfoSize = sizeof (EFI_FONT_INFO) - sizeof (CHAR16) + StringSize; - FontInfo = (EFI_FONT_INFO *) AllocateZeroPool (FontInfoSize); + FontInfo = (EFI_FONT_INFO *) AllocateZeroPool(FontInfoSize); if (FontInfo == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -787,7 +787,7 @@ InsertLackStringBlock ( FrontSkipNum = StringId - StartStringId; } - StringBlock = (UINT8 *) AllocateZeroPool (NewBlockSize); + StringBlock = (UINT8 *) AllocateZeroPool(NewBlockSize); if (StringBlock == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -985,7 +985,7 @@ SetStringWorker ( case EFI_HII_SIBT_STRINGS_SCSU_FONT: BlockSize = OldBlockSize + StrLen (String); BlockSize -= AsciiStrSize ((CHAR8 *) StringTextPtr); - Block = AllocateZeroPool (BlockSize); + Block = AllocateZeroPool(BlockSize); if (Block == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -1022,7 +1022,7 @@ SetStringWorker ( GetUnicodeStringTextOrSize (NULL, StringTextPtr, &StringSize); BlockSize = OldBlockSize + StrSize (String) - StringSize; - Block = AllocateZeroPool (BlockSize); + Block = AllocateZeroPool(BlockSize); if (Block == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -1063,7 +1063,7 @@ SetStringWorker ( BlockSize = OldBlockSize + sizeof (EFI_HII_SIBT_FONT_BLOCK) - sizeof (CHAR16) + StrSize (GlobalFont->FontInfo->FontName); - Block = AllocateZeroPool (BlockSize); + Block = AllocateZeroPool(BlockSize); if (Block == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -1255,7 +1255,7 @@ HiiNewString ( // Ucs2BlockSize = (UINT32) sizeof (EFI_HII_SIBT_STRING_UCS2_BLOCK); - StringBlock = (UINT8 *) AllocateZeroPool (OldBlockSize + Ucs2BlockSize); + StringBlock = (UINT8 *) AllocateZeroPool(OldBlockSize + Ucs2BlockSize); if (StringBlock == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Done; @@ -1305,7 +1305,7 @@ HiiNewString ( goto Done; } - StringPackage = AllocateZeroPool (sizeof (HII_STRING_PACKAGE_INSTANCE)); + StringPackage = AllocateZeroPool(sizeof (HII_STRING_PACKAGE_INSTANCE)); if (StringPackage == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Done; @@ -1320,7 +1320,7 @@ HiiNewString ( // Fill in the string package header // HeaderSize = (UINT32) (AsciiStrSize ((CHAR8 *) Language) - 1 + sizeof (EFI_HII_STRING_PACKAGE_HDR)); - StringPackage->StringPkgHdr = AllocateZeroPool (HeaderSize); + StringPackage->StringPkgHdr = AllocateZeroPool(HeaderSize); if (StringPackage->StringPkgHdr == NULL) { FreePool(StringPackage); Status = EFI_OUT_OF_RESOURCES; @@ -1341,7 +1341,7 @@ HiiNewString ( (*StringId - 1) * sizeof (EFI_HII_SIBT_STRING_UCS2_BLOCK) - sizeof (CHAR16)); BlockSize = Ucs2BlockSize + sizeof (EFI_HII_SIBT_END_BLOCK); - StringPackage->StringBlock = (UINT8 *) AllocateZeroPool (BlockSize); + StringPackage->StringBlock = (UINT8 *) AllocateZeroPool(BlockSize); if (StringPackage->StringBlock == NULL) { FreePool(StringPackage->StringPkgHdr); FreePool(StringPackage); @@ -1384,7 +1384,7 @@ HiiNewString ( Ucs2BlockSize = (UINT32) (StrSize (String) + sizeof (EFI_HII_SIBT_STRING_UCS2_BLOCK) - sizeof (CHAR16)); - StringBlock = (UINT8 *) AllocateZeroPool (OldBlockSize + Ucs2BlockSize); + StringBlock = (UINT8 *) AllocateZeroPool(OldBlockSize + Ucs2BlockSize); if (StringBlock == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Done; @@ -1424,7 +1424,7 @@ HiiNewString ( // // Create a EFI_HII_SIBT_STRING_UCS2_FONT block only. // - StringBlock = (UINT8 *) AllocateZeroPool (OldBlockSize + Ucs2FontBlockSize); + StringBlock = (UINT8 *) AllocateZeroPool(OldBlockSize + Ucs2FontBlockSize); if (StringBlock == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Done; @@ -1461,7 +1461,7 @@ HiiNewString ( // FontBlockSize = (UINT32) (StrSize (((EFI_FONT_INFO *) StringFontInfo)->FontName) + sizeof (EFI_HII_SIBT_FONT_BLOCK) - sizeof (CHAR16)); - StringBlock = (UINT8 *) AllocateZeroPool (OldBlockSize + FontBlockSize + Ucs2FontBlockSize); + StringBlock = (UINT8 *) AllocateZeroPool(OldBlockSize + FontBlockSize + Ucs2FontBlockSize); if (StringBlock == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Done; @@ -2040,13 +2040,13 @@ HiiCompareLanguage ( // Convert to lower to compare. // StrLen = AsciiStrSize (Language1); - Lan1 = AllocateZeroPool (StrLen); + Lan1 = AllocateZeroPool(StrLen); ASSERT (Lan1 != NULL); AsciiStrCpyS(Lan1, StrLen / sizeof (CHAR8), Language1); AsciiHiiToLower (Lan1); StrLen = AsciiStrSize (Language2); - Lan2 = AllocateZeroPool (StrLen); + Lan2 = AllocateZeroPool(StrLen); ASSERT (Lan2 != NULL); AsciiStrCpyS(Lan2, StrLen / sizeof (CHAR8), Language2); AsciiHiiToLower (Lan2); diff --git a/MdeModulePkg/Universal/LoadFileOnFv2/LoadFileOnFv2.c b/MdeModulePkg/Universal/LoadFileOnFv2/LoadFileOnFv2.c index 5bd20fdda..b4ab008ba 100644 --- a/MdeModulePkg/Universal/LoadFileOnFv2/LoadFileOnFv2.c +++ b/MdeModulePkg/Universal/LoadFileOnFv2/LoadFileOnFv2.c @@ -338,7 +338,7 @@ FvNotificationEvent ( Handle = NULL; Index = 0; BufferSize = sizeof (EFI_HANDLE); - Handle = AllocateZeroPool (BufferSize); + Handle = AllocateZeroPool(BufferSize); if (Handle == NULL) { return; } @@ -351,7 +351,7 @@ FvNotificationEvent ( ); if (EFI_BUFFER_TOO_SMALL == Status) { FreePool(Handle); - Handle = AllocateZeroPool (BufferSize); + Handle = AllocateZeroPool(BufferSize); if (Handle == NULL) { return; } diff --git a/MdeModulePkg/Universal/MemoryTest/GenericMemoryTestDxe/LightMemoryTest.c b/MdeModulePkg/Universal/MemoryTest/GenericMemoryTestDxe/LightMemoryTest.c index 18746ca8f..fe8df5ffd 100644 --- a/MdeModulePkg/Universal/MemoryTest/GenericMemoryTestDxe/LightMemoryTest.c +++ b/MdeModulePkg/Universal/MemoryTest/GenericMemoryTestDxe/LightMemoryTest.c @@ -404,7 +404,7 @@ VerifyMemory ( // // Report uncorrectable errors // - ExtendedErrorData = AllocateZeroPool (sizeof (EFI_MEMORY_EXTENDED_ERROR_DATA)); + ExtendedErrorData = AllocateZeroPool(sizeof (EFI_MEMORY_EXTENDED_ERROR_DATA)); if (ExtendedErrorData == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -585,7 +585,7 @@ GenPerformMemoryTest ( // // Report status code of every memory range // - RangeData = AllocateZeroPool (sizeof (EFI_MEMORY_RANGE_EXTENDED_DATA)); + RangeData = AllocateZeroPool(sizeof (EFI_MEMORY_RANGE_EXTENDED_DATA)); if (RangeData == NULL) { return EFI_OUT_OF_RESOURCES; } diff --git a/MdeModulePkg/Universal/PCD/Dxe/Pcd.c b/MdeModulePkg/Universal/PCD/Dxe/Pcd.c index 153256f1e..484d1d7d1 100644 --- a/MdeModulePkg/Universal/PCD/Dxe/Pcd.c +++ b/MdeModulePkg/Universal/PCD/Dxe/Pcd.c @@ -1234,7 +1234,7 @@ GetDistinctTokenSpace ( UINTN Idx; BOOLEAN Match; - DistinctTokenSpace = AllocateZeroPool (*ExMapTableSize * sizeof (EFI_GUID *)); + DistinctTokenSpace = AllocateZeroPool(*ExMapTableSize * sizeof (EFI_GUID *)); ASSERT (DistinctTokenSpace != NULL); TsIdx = 0; diff --git a/MdeModulePkg/Universal/PCD/Dxe/Service.c b/MdeModulePkg/Universal/PCD/Dxe/Service.c index 618541198..d7a6fc06f 100644 --- a/MdeModulePkg/Universal/PCD/Dxe/Service.c +++ b/MdeModulePkg/Universal/PCD/Dxe/Service.c @@ -168,7 +168,7 @@ GetPcdName ( // Need to get the full PCD name. // NameSize = AsciiStrSize (TokenSpaceName) + AsciiStrSize (PcdName); - Name = AllocateZeroPool (NameSize); + Name = AllocateZeroPool(NameSize); ASSERT (Name != NULL); // // Catenate TokenSpaceCName and PcdCName with a '.' to form the full PCD name. @@ -856,7 +856,7 @@ BuildPcdDxeDataBase ( mPcdDatabase.DxeDb = LocateExPcdBinary (); ASSERT(mPcdDatabase.DxeDb != NULL); PcdDxeDbLen = mPcdDatabase.DxeDb->Length + mPcdDatabase.DxeDb->UninitDataBaseSize; - PcdDxeDb = AllocateZeroPool (PcdDxeDbLen); + PcdDxeDb = AllocateZeroPool(PcdDxeDbLen); ASSERT (PcdDxeDb != NULL); CopyMem (PcdDxeDb, mPcdDatabase.DxeDb, mPcdDatabase.DxeDb->Length); mPcdDatabase.DxeDb = PcdDxeDb; @@ -894,7 +894,7 @@ BuildPcdDxeDataBase ( } mPcdDatabase.DxeDb->SystemSkuId = mPcdDatabase.PeiDb->SystemSkuId; } else { - mPcdDatabase.PeiDb = AllocateZeroPool (sizeof (PEI_PCD_DATABASE)); + mPcdDatabase.PeiDb = AllocateZeroPool(sizeof (PEI_PCD_DATABASE)); ASSERT(mPcdDatabase.PeiDb != NULL); } @@ -923,7 +923,7 @@ BuildPcdDxeDataBase ( // // Initialized the Callback Function Table // - mCallbackFnTable = AllocateZeroPool (mPcdTotalTokenCount * sizeof (LIST_ENTRY)); + mCallbackFnTable = AllocateZeroPool(mPcdTotalTokenCount * sizeof (LIST_ENTRY)); ASSERT(mCallbackFnTable != NULL); // @@ -1516,7 +1516,7 @@ SetHiiVariable ( // Get size, allocate buffer and get data. // GetVariableSizeAndDataFromHiiPcd (VariableGuid, VariableName, &Size, NULL); - Buffer = AllocateZeroPool (Size); + Buffer = AllocateZeroPool(Size); ASSERT (Buffer != NULL); GetVariableSizeAndDataFromHiiPcd (VariableGuid, VariableName, &Size, Buffer); diff --git a/MdeModulePkg/Universal/PCD/Pei/Service.c b/MdeModulePkg/Universal/PCD/Pei/Service.c index 7e5523bbf..259018a78 100644 --- a/MdeModulePkg/Universal/PCD/Pei/Service.c +++ b/MdeModulePkg/Universal/PCD/Pei/Service.c @@ -127,7 +127,7 @@ GetPcdName ( // Need to get the full PCD name. // NameSize = AsciiStrSize (TokenSpaceName) + AsciiStrSize (PcdName); - Name = AllocateZeroPool (NameSize); + Name = AllocateZeroPool(NameSize); ASSERT (Name != NULL); // // Catenate TokenSpaceCName and PcdCName with a '.' to form the full PCD name. diff --git a/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideDxe.c b/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideDxe.c index 765ccd8ad..35ef2706c 100644 --- a/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideDxe.c +++ b/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideDxe.c @@ -421,9 +421,9 @@ UpdateDeviceSelectPage ( } mMaxDeviceCount = DevicePathHandleCount; - mControllerDevicePathProtocol = AllocateZeroPool (DevicePathHandleCount * sizeof (EFI_DEVICE_PATH_PROTOCOL *)); + mControllerDevicePathProtocol = AllocateZeroPool(DevicePathHandleCount * sizeof (EFI_DEVICE_PATH_PROTOCOL *)); ASSERT (mControllerDevicePathProtocol != NULL); - mControllerToken = AllocateZeroPool (DevicePathHandleCount * sizeof (EFI_STRING_ID)); + mControllerToken = AllocateZeroPool(DevicePathHandleCount * sizeof (EFI_STRING_ID)); ASSERT (mControllerToken != NULL); for (Index = 0; Index < DevicePathHandleCount; Index++) { @@ -485,7 +485,7 @@ UpdateDeviceSelectPage ( // Len = StrSize (ControllerName); NewStrSize = Len + StrSize (L"--"); - NewString = AllocateZeroPool (NewStrSize); + NewString = AllocateZeroPool(NewStrSize); ASSERT (NewString != NULL); if (EFI_ERROR(CheckMapping (ControllerDevicePath,NULL, &mMappingDataBase, NULL, NULL))) { StrCatS (NewString, NewStrSize/sizeof(CHAR16), L"--"); @@ -704,14 +704,14 @@ UpdateBindingDriverSelectPage ( return EFI_NOT_FOUND; } - mDriverImageToken = AllocateZeroPool (DriverImageHandleCount * sizeof (EFI_STRING_ID)); + mDriverImageToken = AllocateZeroPool(DriverImageHandleCount * sizeof (EFI_STRING_ID)); ASSERT (mDriverImageToken != NULL); - mDriSelection = AllocateZeroPool (DriverImageHandleCount * sizeof (BOOLEAN)); + mDriSelection = AllocateZeroPool(DriverImageHandleCount * sizeof (BOOLEAN)); ASSERT (mDriSelection != NULL); - DriverImageProtocol = AllocateZeroPool (DriverImageHandleCount * sizeof (EFI_LOADED_IMAGE_PROTOCOL *)); + DriverImageProtocol = AllocateZeroPool(DriverImageHandleCount * sizeof (EFI_LOADED_IMAGE_PROTOCOL *)); ASSERT (DriverImageProtocol != NULL); - DriverImageFilePathToken = AllocateZeroPool (DriverImageHandleCount * sizeof (EFI_STRING_ID)); + DriverImageFilePathToken = AllocateZeroPool(DriverImageHandleCount * sizeof (EFI_STRING_ID)); ASSERT (DriverImageFilePathToken != NULL); mDriverImageHandleCount = DriverImageHandleCount; @@ -812,7 +812,7 @@ UpdateBindingDriverSelectPage ( // First create the driver image name // NewStrSize = StrSize (DriverName); - NewString = AllocateZeroPool (NewStrSize); + NewString = AllocateZeroPool(NewStrSize); ASSERT (NewString != NULL); if (EFI_ERROR(CheckMapping (mControllerDevicePathProtocol[mSelectedCtrIndex], LoadedImageDevicePath, &mMappingDataBase, NULL, NULL))) { mDriSelection[Index] = FALSE; @@ -835,7 +835,7 @@ UpdateBindingDriverSelectPage ( DriverName = DevicePathToStr (LoadedImageDevicePath); NewStrSize = StrSize (DriverName); - NewString = AllocateZeroPool (NewStrSize); + NewString = AllocateZeroPool(NewStrSize); ASSERT (NewString != NULL); StrCatS (NewString, NewStrSize/sizeof(CHAR16), DriverName); NewStringHelpToken = HiiSetString (Private->RegisteredHandle, DriverImageFilePathToken[Index], NewString, NULL); @@ -1208,7 +1208,7 @@ PlatOverMngrExtractConfig ( // ConfigRequestHdr = HiiConstructConfigHdr (&gPlatformOverridesManagerGuid, mVariableName, Private->DriverHandle); Size = (StrLen (ConfigRequestHdr) + 32 + 1) * sizeof (CHAR16); - ConfigRequest = AllocateZeroPool (Size); + ConfigRequest = AllocateZeroPool(Size); ASSERT (ConfigRequest != NULL); AllocatedRequest = TRUE; BufferSize = sizeof (PLAT_OVER_MNGR_DATA); @@ -1622,7 +1622,7 @@ PlatDriOverrideDxeInit ( } mCallerImageHandle = ImageHandle; - mCallbackInfo = AllocateZeroPool (sizeof (EFI_CALLBACK_INFO)); + mCallbackInfo = AllocateZeroPool(sizeof (EFI_CALLBACK_INFO)); if (mCallbackInfo == NULL) { return EFI_BAD_BUFFER_SIZE; } diff --git a/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideLib.c b/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideLib.c index 85dea492a..a309518f7 100644 --- a/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideLib.c +++ b/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideLib.c @@ -57,7 +57,7 @@ PushDevPathStack ( { DEVICE_PATH_STACK_ITEM *DevicePathStackItem; - DevicePathStackItem = AllocateZeroPool (sizeof (DEVICE_PATH_STACK_ITEM)); + DevicePathStackItem = AllocateZeroPool(sizeof (DEVICE_PATH_STACK_ITEM)); ASSERT (DevicePathStackItem != NULL); DevicePathStackItem->Signature = DEVICE_PATH_STACK_ITEM_SIGNATURE; DevicePathStackItem->DevicePath = DuplicateDevicePath (DevicePath); @@ -402,7 +402,7 @@ GetVariableAndSize ( // // Allocate the buffer to return // - Buffer = AllocateZeroPool (BufferSize); + Buffer = AllocateZeroPool(BufferSize); if (Buffer == NULL) { return NULL; } @@ -717,7 +717,7 @@ InitOverridesMapping ( // // Create PLATFORM_OVERRIDE_ITEM for this mapping // - OverrideItem = AllocateZeroPool (sizeof (PLATFORM_OVERRIDE_ITEM)); + OverrideItem = AllocateZeroPool(sizeof (PLATFORM_OVERRIDE_ITEM)); ASSERT (OverrideItem != NULL); OverrideItem->Signature = PLATFORM_OVERRIDE_ITEM_SIGNATURE; InitializeListHead (&OverrideItem->DriverInfoList); @@ -758,7 +758,7 @@ InitOverridesMapping ( // // Create DRIVER_IMAGE_INFO for this DriverDevicePath[] // - DriverImageInfo = AllocateZeroPool (sizeof (DRIVER_IMAGE_INFO)); + DriverImageInfo = AllocateZeroPool(sizeof (DRIVER_IMAGE_INFO)); ASSERT (DriverImageInfo != NULL); DriverImageInfo->Signature = DRIVER_IMAGE_INFO_SIGNATURE; @@ -1022,7 +1022,7 @@ SaveOverridesMapping ( // VariableNeededSize is the most proper variable size, allocate variable buffer // ItemIndex now points to the next PLATFORM_OVERRIDE_ITEM which is not covered by VariableNeededSize // - VariableBuffer = AllocateZeroPool (VariableNeededSize); + VariableBuffer = AllocateZeroPool(VariableNeededSize); ASSERT (VariableBuffer != NULL); ASSERT ((UINTN) VariableBuffer % sizeof(UINTN) == 0); @@ -1743,7 +1743,7 @@ InsertDriverImage ( // Add the Controller related PLATFORM_OVERRIDE_ITEM structrue in mapping data base // if (!Found) { - OverrideItem = AllocateZeroPool (sizeof (PLATFORM_OVERRIDE_ITEM)); + OverrideItem = AllocateZeroPool(sizeof (PLATFORM_OVERRIDE_ITEM)); ASSERT (OverrideItem != NULL); OverrideItem->Signature = PLATFORM_OVERRIDE_ITEM_SIGNATURE; OverrideItem->ControllerDevicePath = DuplicateDevicePath (ControllerDevicePath); @@ -1754,7 +1754,7 @@ InsertDriverImage ( // // Prepare the driver image related DRIVER_IMAGE_INFO structure. // - DriverImageInfo = AllocateZeroPool (sizeof (DRIVER_IMAGE_INFO)); + DriverImageInfo = AllocateZeroPool(sizeof (DRIVER_IMAGE_INFO)); ASSERT (DriverImageInfo != NULL); DriverImageInfo->Signature = DRIVER_IMAGE_INFO_SIGNATURE; DriverImageInfo->DriverImagePath = DuplicateDevicePath (DriverImageDevicePath); diff --git a/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.c b/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.c index c60f5aa6d..d178f3d48 100644 --- a/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.c +++ b/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.c @@ -160,7 +160,7 @@ OnigurumaMatch ( // if (*Result && Captures != NULL) { *CapturesCount = Region->num_regs; - *Captures = AllocateZeroPool (*CapturesCount * sizeof(**Captures)); + *Captures = AllocateZeroPool(*CapturesCount * sizeof(**Captures)); if (*Captures != NULL) { for (Index = 0; Index < *CapturesCount; ++Index) { // diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c b/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c index b999892e3..fe8e85e75 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c @@ -1192,7 +1192,7 @@ IfrToString ( SrcLen = GetLengthForValue(&Value); } - TmpBuf = AllocateZeroPool (SrcLen + 3); + TmpBuf = AllocateZeroPool(SrcLen + 3); ASSERT (TmpBuf != NULL); if (Format == EFI_IFR_STRING_ASCII) { CopyMem (TmpBuf, SrcBuf, SrcLen); @@ -1373,7 +1373,7 @@ IfrCatenate ( Length1 = GetLengthForValue(&Value[1]); Result->BufferLen = (UINT16) (Length0 + Length1); - Result->Buffer = AllocateZeroPool (Result->BufferLen); + Result->Buffer = AllocateZeroPool(Result->BufferLen); ASSERT (Result->Buffer != NULL); TmpBuf = GetBufferForValue(&Value[0]); @@ -1833,7 +1833,7 @@ IfrMid ( Result->Buffer = NULL; } else { Result->BufferLen = (UINT16)((BufferLen - Base) < Length ? (BufferLen - Base) : Length); - Result->Buffer = AllocateZeroPool (Result->BufferLen); + Result->Buffer = AllocateZeroPool(Result->BufferLen); ASSERT (Result->Buffer != NULL); CopyMem (Result->Buffer, &Buffer[Base], Result->BufferLen); } @@ -2441,7 +2441,7 @@ GetQuestionValueFromForm ( // // Get the formset data include this question. // - FormSet = AllocateZeroPool (sizeof (FORM_BROWSER_FORMSET)); + FormSet = AllocateZeroPool(sizeof (FORM_BROWSER_FORMSET)); ASSERT (FormSet != NULL); Status = InitializeFormSet(HiiHandle, FormSetGuid, FormSet); if (EFI_ERROR(Status)) { @@ -3130,7 +3130,7 @@ EvaluateExpression ( break; case EFI_HII_VARSTORE_NAME_VALUE: if (OpCode->ValueType != EFI_IFR_TYPE_STRING) { - NameValue = AllocateZeroPool ((OpCode->ValueWidth * 2 + 1) * sizeof (CHAR16)); + NameValue = AllocateZeroPool((OpCode->ValueWidth * 2 + 1) * sizeof (CHAR16)); ASSERT (NameValue != NULL); // // Convert Buffer to Hex String diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c b/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c index db7d81016..b0bd48228 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c @@ -174,14 +174,14 @@ CreateQuestion ( // // Insert to Name/Value varstore list // - NameValueNode = AllocateZeroPool (sizeof (NAME_VALUE_NODE)); + NameValueNode = AllocateZeroPool(sizeof (NAME_VALUE_NODE)); ASSERT (NameValueNode != NULL); NameValueNode->Signature = NAME_VALUE_NODE_SIGNATURE; NameValueNode->Name = AllocateCopyPool(StrSize (Statement->VariableName), Statement->VariableName); ASSERT (NameValueNode->Name != NULL); - NameValueNode->Value = AllocateZeroPool (0x10); + NameValueNode->Value = AllocateZeroPool(0x10); ASSERT (NameValueNode->Value != NULL); - NameValueNode->EditValue = AllocateZeroPool (0x10); + NameValueNode->EditValue = AllocateZeroPool(0x10); ASSERT (NameValueNode->EditValue != NULL); InsertTailList (&Statement->Storage->NameValueListHead, &NameValueNode->Link); @@ -210,7 +210,7 @@ CreateExpression ( { FORM_EXPRESSION *Expression; - Expression = AllocateZeroPool (sizeof (FORM_EXPRESSION)); + Expression = AllocateZeroPool(sizeof (FORM_EXPRESSION)); ASSERT (Expression != NULL); Expression->Signature = FORM_EXPRESSION_SIGNATURE; InitializeListHead (&Expression->OpCodeListHead); @@ -335,8 +335,8 @@ IntializeBrowserStorage ( CopyMem (&BrowserStorage->Guid, &((EFI_IFR_VARSTORE *) OpCodeData)->Guid, sizeof (EFI_GUID)); CopyMem (&BrowserStorage->Size, &((EFI_IFR_VARSTORE *) OpCodeData)->Size, sizeof (UINT16)); - BrowserStorage->Buffer = AllocateZeroPool (BrowserStorage->Size); - BrowserStorage->EditBuffer = AllocateZeroPool (BrowserStorage->Size); + BrowserStorage->Buffer = AllocateZeroPool(BrowserStorage->Size); + BrowserStorage->EditBuffer = AllocateZeroPool(BrowserStorage->Size); break; case EFI_HII_VARSTORE_EFI_VARIABLE: @@ -346,8 +346,8 @@ IntializeBrowserStorage ( CopyMem (&BrowserStorage->Size, &((EFI_IFR_VARSTORE_EFI *) OpCodeData)->Size, sizeof (UINT16)); if (StorageType == EFI_HII_VARSTORE_EFI_VARIABLE_BUFFER) { - BrowserStorage->Buffer = AllocateZeroPool (BrowserStorage->Size); - BrowserStorage->EditBuffer = AllocateZeroPool (BrowserStorage->Size); + BrowserStorage->Buffer = AllocateZeroPool(BrowserStorage->Size); + BrowserStorage->EditBuffer = AllocateZeroPool(BrowserStorage->Size); } break; @@ -410,21 +410,21 @@ CreateStorage ( if (StorageType != EFI_HII_VARSTORE_NAME_VALUE) { ASSERT (StorageName != NULL); - UnicodeString = AllocateZeroPool (AsciiStrSize (StorageName) * 2); + UnicodeString = AllocateZeroPool(AsciiStrSize (StorageName) * 2); ASSERT (UnicodeString != NULL); for (Index = 0; StorageName[Index] != 0; Index++) { UnicodeString[Index] = (CHAR16) StorageName[Index]; } } - Storage = AllocateZeroPool (sizeof (FORMSET_STORAGE)); + Storage = AllocateZeroPool(sizeof (FORMSET_STORAGE)); ASSERT (Storage != NULL); Storage->Signature = FORMSET_STORAGE_SIGNATURE; InsertTailList (&FormSet->StorageListHead, &Storage->Link); BrowserStorage = FindStorageInList(StorageType, StorageGuid, UnicodeString, FormSet->HiiHandle); if (BrowserStorage == NULL) { - BrowserStorage = AllocateZeroPool (sizeof (BROWSER_STORAGE)); + BrowserStorage = AllocateZeroPool(sizeof (BROWSER_STORAGE)); ASSERT (BrowserStorage != NULL); BrowserStorage->Signature = BROWSER_STORAGE_SIGNATURE; @@ -623,7 +623,7 @@ InitializeRequestElement ( // Old String buffer is not sufficient for RequestElement, allocate a new one // MaxLen = StringSize / sizeof (CHAR16) + CONFIG_REQUEST_STRING_INCREMENTAL; - NewStr = AllocateZeroPool (MaxLen * sizeof (CHAR16)); + NewStr = AllocateZeroPool(MaxLen * sizeof (CHAR16)); ASSERT (NewStr != NULL); if (FormsetStorage->ConfigRequest != NULL) { CopyMem (NewStr, FormsetStorage->ConfigRequest, StringSize); @@ -675,7 +675,7 @@ InitializeRequestElement ( // Old String buffer is not sufficient for RequestElement, allocate a new one // MaxLen = StringSize / sizeof (CHAR16) + CONFIG_REQUEST_STRING_INCREMENTAL; - NewStr = AllocateZeroPool (MaxLen * sizeof (CHAR16)); + NewStr = AllocateZeroPool(MaxLen * sizeof (CHAR16)); ASSERT (NewStr != NULL); if (ConfigInfo->ConfigRequest != NULL) { CopyMem (NewStr, ConfigInfo->ConfigRequest, StringSize); @@ -1224,13 +1224,13 @@ ParseOpCodes ( mStatementIndex = 0; mUsedQuestionId = 1; - FormSet->StatementBuffer = AllocateZeroPool (NumberOfStatement * sizeof (FORM_BROWSER_STATEMENT)); + FormSet->StatementBuffer = AllocateZeroPool(NumberOfStatement * sizeof (FORM_BROWSER_STATEMENT)); if (FormSet->StatementBuffer == NULL) { return EFI_OUT_OF_RESOURCES; } mExpressionOpCodeIndex = 0; - FormSet->ExpressionBuffer = AllocateZeroPool (NumberOfExpression * sizeof (EXPRESSION_OPCODE)); + FormSet->ExpressionBuffer = AllocateZeroPool(NumberOfExpression * sizeof (EXPRESSION_OPCODE)); if (FormSet->ExpressionBuffer == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -1614,7 +1614,7 @@ ParseOpCodes ( // // Create a new Form for this FormSet // - CurrentForm = AllocateZeroPool (sizeof (FORM_BROWSER_FORM)); + CurrentForm = AllocateZeroPool(sizeof (FORM_BROWSER_FORM)); ASSERT (CurrentForm != NULL); CurrentForm->Signature = FORM_BROWSER_FORM_SIGNATURE; InitializeListHead (&CurrentForm->ExpressionListHead); @@ -1656,7 +1656,7 @@ ParseOpCodes ( // // Create a new Form for this FormSet // - CurrentForm = AllocateZeroPool (sizeof (FORM_BROWSER_FORM)); + CurrentForm = AllocateZeroPool(sizeof (FORM_BROWSER_FORM)); ASSERT (CurrentForm != NULL); CurrentForm->Signature = FORM_BROWSER_FORM_SIGNATURE; InitializeListHead (&CurrentForm->ExpressionListHead); @@ -1760,7 +1760,7 @@ ParseOpCodes ( // case EFI_IFR_DEFAULTSTORE_OP: HaveInserted = FALSE; - DefaultStore = AllocateZeroPool (sizeof (FORMSET_DEFAULTSTORE)); + DefaultStore = AllocateZeroPool(sizeof (FORMSET_DEFAULTSTORE)); ASSERT (DefaultStore != NULL); DefaultStore->Signature = FORMSET_DEFAULTSTORE_SIGNATURE; @@ -2009,7 +2009,7 @@ ParseOpCodes ( CurrentStatement->Flags = ((EFI_IFR_STRING *) OpCodeData)->Flags; CurrentStatement->HiiValue.Type = EFI_IFR_TYPE_STRING; - CurrentStatement->BufferValue = AllocateZeroPool (CurrentStatement->StorageWidth + sizeof (CHAR16)); + CurrentStatement->BufferValue = AllocateZeroPool(CurrentStatement->StorageWidth + sizeof (CHAR16)); CurrentStatement->HiiValue.Value.string = NewString ((CHAR16*) CurrentStatement->BufferValue, FormSet->HiiHandle); InitializeRequestElement (FormSet, CurrentStatement, CurrentForm); @@ -2028,7 +2028,7 @@ ParseOpCodes ( CurrentStatement->StorageWidth = (UINT16)((UINTN) CurrentStatement->Maximum * sizeof (CHAR16)); CurrentStatement->HiiValue.Type = EFI_IFR_TYPE_STRING; - CurrentStatement->BufferValue = AllocateZeroPool ((CurrentStatement->StorageWidth + sizeof (CHAR16))); + CurrentStatement->BufferValue = AllocateZeroPool((CurrentStatement->StorageWidth + sizeof (CHAR16))); CurrentStatement->HiiValue.Value.string = NewString ((CHAR16*) CurrentStatement->BufferValue, FormSet->HiiHandle); InitializeRequestElement (FormSet, CurrentStatement, CurrentForm); @@ -2083,7 +2083,7 @@ ParseOpCodes ( // It creates a default value for the current question. // A Question may have more than one Default value which have different default types. // - CurrentDefault = AllocateZeroPool (sizeof (QUESTION_DEFAULT)); + CurrentDefault = AllocateZeroPool(sizeof (QUESTION_DEFAULT)); ASSERT (CurrentDefault != NULL); CurrentDefault->Signature = QUESTION_DEFAULT_SIGNATURE; @@ -2117,7 +2117,7 @@ ParseOpCodes ( // // It's keep the default value for ordered list opcode. // - CurrentDefault = AllocateZeroPool (sizeof (QUESTION_DEFAULT)); + CurrentDefault = AllocateZeroPool(sizeof (QUESTION_DEFAULT)); ASSERT (CurrentDefault != NULL); CurrentDefault->Signature = QUESTION_DEFAULT_SIGNATURE; @@ -2143,7 +2143,7 @@ ParseOpCodes ( // EFI_IFR_ONE_OF_OPTION appear in scope of a Question. // It create a selection for use in current Question. // - CurrentOption = AllocateZeroPool (sizeof (QUESTION_OPTION)); + CurrentOption = AllocateZeroPool(sizeof (QUESTION_OPTION)); ASSERT (CurrentOption != NULL); CurrentOption->Signature = QUESTION_OPTION_SIGNATURE; CurrentOption->OpCode = (EFI_IFR_ONE_OF_OPTION *) OpCodeData; @@ -2201,7 +2201,7 @@ ParseOpCodes ( } ParentStatement->StorageWidth = (UINT16) (ParentStatement->MaxContainers * Width); - ParentStatement->BufferValue = AllocateZeroPool (ParentStatement->StorageWidth); + ParentStatement->BufferValue = AllocateZeroPool(ParentStatement->StorageWidth); ParentStatement->ValueType = CurrentOption->Value.Type; if (ParentStatement->HiiValue.Type == EFI_IFR_TYPE_BUFFER) { ParentStatement->HiiValue.Buffer = ParentStatement->BufferValue; @@ -2312,7 +2312,7 @@ ParseOpCodes ( // The DisableIf expression should only rely on constant, so it could be // evaluated at initialization and it will not be queued // - CurrentExpression = AllocateZeroPool (sizeof (FORM_EXPRESSION)); + CurrentExpression = AllocateZeroPool(sizeof (FORM_EXPRESSION)); ASSERT (CurrentExpression != NULL); CurrentExpression->Signature = FORM_EXPRESSION_SIGNATURE; CurrentExpression->Type = EFI_HII_EXPRESSION_DISABLE_IF; diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c index 17450e731..611807dcc 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c @@ -246,7 +246,7 @@ CreateRefreshEventForStatement ( &RefreshEvent); ASSERT_EFI_ERROR(Status); - EventNode = AllocateZeroPool (sizeof (FORM_BROWSER_REFRESH_EVENT_NODE)); + EventNode = AllocateZeroPool(sizeof (FORM_BROWSER_REFRESH_EVENT_NODE)); ASSERT (EventNode != NULL); EventNode->RefreshEvent = RefreshEvent; InsertTailList(&mRefreshEventList, &EventNode->Link); @@ -279,7 +279,7 @@ CreateRefreshEventForForm ( &RefreshEvent); ASSERT_EFI_ERROR(Status); - EventNode = AllocateZeroPool (sizeof (FORM_BROWSER_REFRESH_EVENT_NODE)); + EventNode = AllocateZeroPool(sizeof (FORM_BROWSER_REFRESH_EVENT_NODE)); ASSERT (EventNode != NULL); EventNode->RefreshEvent = RefreshEvent; InsertTailList(&mRefreshEventList, &EventNode->Link); @@ -328,7 +328,7 @@ InitializeDisplayStatement ( continue; } - DisplayOption = AllocateZeroPool (sizeof (DISPLAY_QUESTION_OPTION)); + DisplayOption = AllocateZeroPool(sizeof (DISPLAY_QUESTION_OPTION)); ASSERT (DisplayOption != NULL); DisplayOption->ImageId = Option->ImageId; @@ -544,7 +544,7 @@ AddStatementToDisplayForm ( Statement = FORM_BROWSER_STATEMENT_FROM_LINK (Link); Link = GetNextNode (&gCurrentSelection->FormSet->StatementListOSF, Link); - DisplayStatement = AllocateZeroPool (sizeof (FORM_DISPLAY_ENGINE_STATEMENT)); + DisplayStatement = AllocateZeroPool(sizeof (FORM_DISPLAY_ENGINE_STATEMENT)); ASSERT (DisplayStatement != NULL); DisplayStatement->Signature = FORM_DISPLAY_ENGINE_STATEMENT_SIGNATURE; DisplayStatement->Version = FORM_DISPLAY_ENGINE_STATEMENT_VERSION_1; @@ -559,7 +559,7 @@ AddStatementToDisplayForm ( // // treat formset as statement outside the form,get its opcode. // - DisplayStatement = AllocateZeroPool (sizeof (FORM_DISPLAY_ENGINE_STATEMENT)); + DisplayStatement = AllocateZeroPool(sizeof (FORM_DISPLAY_ENGINE_STATEMENT)); ASSERT (DisplayStatement != NULL); DisplayStatement->Signature = FORM_DISPLAY_ENGINE_STATEMENT_SIGNATURE; @@ -594,7 +594,7 @@ AddStatementToDisplayForm ( continue; } - DisplayStatement = AllocateZeroPool (sizeof (FORM_DISPLAY_ENGINE_STATEMENT)); + DisplayStatement = AllocateZeroPool(sizeof (FORM_DISPLAY_ENGINE_STATEMENT)); ASSERT (DisplayStatement != NULL); // @@ -629,7 +629,7 @@ AddStatementToDisplayForm ( Status = gBS->SetTimer (RefreshIntervalEvent, TimerPeriodic, MinRefreshInterval * ONE_SECOND); ASSERT_EFI_ERROR(Status); - EventNode = AllocateZeroPool (sizeof (FORM_BROWSER_REFRESH_EVENT_NODE)); + EventNode = AllocateZeroPool(sizeof (FORM_BROWSER_REFRESH_EVENT_NODE)); ASSERT (EventNode != NULL); EventNode->RefreshEvent = RefreshIntervalEvent; InsertTailList(&mRefreshEventList, &EventNode->Link); diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c index e4a445468..5a3240e3c 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c @@ -90,7 +90,7 @@ UiAddMenuList ( { FORM_ENTRY_INFO *MenuList; - MenuList = AllocateZeroPool (sizeof (FORM_ENTRY_INFO)); + MenuList = AllocateZeroPool(sizeof (FORM_ENTRY_INFO)); if (MenuList == NULL) { return NULL; } @@ -304,7 +304,7 @@ UiCopyMenuList ( MenuList = FORM_ENTRY_INFO_FROM_LINK (Link); Link = GetNextNode (CurrentMenuListHead, Link); - NewMenuEntry = AllocateZeroPool (sizeof (FORM_ENTRY_INFO)); + NewMenuEntry = AllocateZeroPool(sizeof (FORM_ENTRY_INFO)); ASSERT (NewMenuEntry != NULL); NewMenuEntry->Signature = FORM_ENTRY_INFO_SIGNATURE; NewMenuEntry->HiiHandle = MenuList->HiiHandle; @@ -354,7 +354,7 @@ LoadAllHiiFormset ( // // Initilize FormSet Setting // - LocalFormSet = AllocateZeroPool (sizeof (FORM_BROWSER_FORMSET)); + LocalFormSet = AllocateZeroPool(sizeof (FORM_BROWSER_FORMSET)); ASSERT (LocalFormSet != NULL); mSystemLevelFormSet = LocalFormSet; @@ -407,7 +407,7 @@ PopupErrorMessage ( Statement = NULL; if (OpCode != NULL) { - Statement = AllocateZeroPool (sizeof(FORM_DISPLAY_ENGINE_STATEMENT)); + Statement = AllocateZeroPool(sizeof(FORM_DISPLAY_ENGINE_STATEMENT)); ASSERT (Statement != NULL); Statement->OpCode = OpCode; gDisplayFormData.HighLightedStatement = Statement; @@ -502,7 +502,7 @@ SendForm ( gDisplayFormData.ScreenDimensions = (EFI_SCREEN_DESCRIPTOR *) ScreenDimensions; for (Index = 0; Index < HandleCount; Index++) { - Selection = AllocateZeroPool (sizeof (UI_MENU_SELECTION)); + Selection = AllocateZeroPool(sizeof (UI_MENU_SELECTION)); ASSERT (Selection != NULL); Selection->Handle = Handles[Index]; @@ -514,7 +514,7 @@ SendForm ( } do { - FormSet = AllocateZeroPool (sizeof (FORM_BROWSER_FORMSET)); + FormSet = AllocateZeroPool(sizeof (FORM_BROWSER_FORMSET)); ASSERT (FormSet != NULL); // @@ -669,7 +669,7 @@ ProcessStorage ( TmpSize = StrLen (*ResultsData); BufferSize = (TmpSize + StrLen (BrowserStorage->ConfigHdr) + 2) * sizeof (CHAR16); MaxLen = BufferSize / sizeof (CHAR16); - ConfigResp = AllocateZeroPool (BufferSize); + ConfigResp = AllocateZeroPool(BufferSize); ASSERT (ConfigResp != NULL); StrCpyS (ConfigResp, MaxLen, BrowserStorage->ConfigHdr); @@ -1083,7 +1083,7 @@ NewStringCat ( } MaxLen = ( StrSize (*Dest) + StrSize (Src) - 1) / sizeof (CHAR16); - NewString = AllocateZeroPool (MaxLen * sizeof (CHAR16)); + NewString = AllocateZeroPool(MaxLen * sizeof (CHAR16)); ASSERT (NewString != NULL); StrCpyS (NewString, MaxLen, *Dest); @@ -1479,7 +1479,7 @@ BufferToValue ( // Other type of Questions // if (Question->QuestionReferToBitField) { - Buffer = (UINT8 *)AllocateZeroPool (Question->StorageWidth); + Buffer = (UINT8 *)AllocateZeroPool(Question->StorageWidth); if (Buffer == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -1798,7 +1798,7 @@ GetQuestionValue ( } // Allocate buffer include '\0' MaxLen = Length + 1; - ConfigRequest = AllocateZeroPool (MaxLen * sizeof (CHAR16)); + ConfigRequest = AllocateZeroPool(MaxLen * sizeof (CHAR16)); ASSERT (ConfigRequest != NULL); StrCpyS (ConfigRequest, MaxLen, FormsetStorage->ConfigHdr); @@ -2060,7 +2060,7 @@ SetQuestionValue ( // Value = NULL; BufferLen = ((StrLen ((CHAR16 *) Src) * 4) + 1) * sizeof (CHAR16); - Value = AllocateZeroPool (BufferLen); + Value = AllocateZeroPool(BufferLen); ASSERT (Value != NULL); // // Convert Unicode String to Config String, e.g. "ABCD" => "0041004200430044" @@ -2079,7 +2079,7 @@ SetQuestionValue ( } } else { BufferLen = StorageWidth * 2 + 1; - Value = AllocateZeroPool (BufferLen * sizeof (CHAR16)); + Value = AllocateZeroPool(BufferLen * sizeof (CHAR16)); ASSERT (Value != NULL); // // Convert Buffer to Hex String @@ -2122,7 +2122,7 @@ SetQuestionValue ( FormsetStorage = GetFstStgFromVarId(FormSet, Question->VarStoreId); ASSERT (FormsetStorage != NULL); MaxLen = StrLen (FormsetStorage->ConfigHdr) + Length + 1; - ConfigResp = AllocateZeroPool (MaxLen * sizeof (CHAR16)); + ConfigResp = AllocateZeroPool(MaxLen * sizeof (CHAR16)); ASSERT (ConfigResp != NULL); StrCpyS (ConfigResp, MaxLen, FormsetStorage->ConfigHdr); @@ -3056,7 +3056,7 @@ GetSyncRestoreConfigRequest( // RestoreEleSize = StrSize (ElementStr); TotalSize = (ConfigHdrEndStr - ConfigRequest) * sizeof (CHAR16) + RestoreEleSize + sizeof (CHAR16); - *RestoreConfigRequest = AllocateZeroPool (TotalSize); + *RestoreConfigRequest = AllocateZeroPool(TotalSize); ASSERT (*RestoreConfigRequest != NULL); StrnCpyS (*RestoreConfigRequest, TotalSize / sizeof (CHAR16), ConfigRequest, ConfigHdrEndStr - ConfigRequest); StrCatS (*RestoreConfigRequest, TotalSize / sizeof (CHAR16), ElementStr); @@ -3064,7 +3064,7 @@ GetSyncRestoreConfigRequest( // To get the SyncConfigRequest. // SyncSize = StrSize (ConfigRequest) - RestoreEleSize + sizeof (CHAR16); - *SyncConfigRequest = AllocateZeroPool (SyncSize); + *SyncConfigRequest = AllocateZeroPool(SyncSize); ASSERT (*SyncConfigRequest != NULL); StrnCpyS (*SyncConfigRequest, SyncSize / sizeof (CHAR16), ConfigRequest, SyncSize / sizeof (CHAR16) - 1); @@ -3099,7 +3099,7 @@ ConfirmSaveFail ( FormTitle = GetToken (TitleId, HiiHandle); - StringBuffer = AllocateZeroPool (256 * sizeof (CHAR16)); + StringBuffer = AllocateZeroPool(256 * sizeof (CHAR16)); ASSERT (StringBuffer != NULL); UnicodeSPrint ( @@ -3138,7 +3138,7 @@ ConfirmNoSubmitFail ( FormTitle = GetToken (TitleId, HiiHandle); - StringBuffer = AllocateZeroPool (256 * sizeof (CHAR16)); + StringBuffer = AllocateZeroPool(256 * sizeof (CHAR16)); ASSERT (StringBuffer != NULL); UnicodeSPrint ( @@ -5359,7 +5359,7 @@ AppendConfigRequest ( // Old String buffer is not sufficient for RequestElement, allocate a new one // MaxLen = StringSize / sizeof (CHAR16) + CONFIG_REQUEST_STRING_INCREMENTAL; - NewStr = AllocateZeroPool (MaxLen * sizeof (CHAR16)); + NewStr = AllocateZeroPool(MaxLen * sizeof (CHAR16)); ASSERT (NewStr != NULL); if (*ConfigRequest != NULL) { @@ -5560,7 +5560,7 @@ LoadStorage ( // followed by "&OFFSET=0&WIDTH=WWWW"followed by a Null-terminator // StrLen = StrSize (Storage->ConfigHdr) + 20 * sizeof (CHAR16); - ConfigRequest = AllocateZeroPool (StrLen); + ConfigRequest = AllocateZeroPool(StrLen); ASSERT (ConfigRequest != NULL); UnicodeSPrint ( ConfigRequest, @@ -6408,7 +6408,7 @@ RegisterHotKey ( // // Create new Key, and add it into List. // - HotKey = AllocateZeroPool (sizeof (BROWSER_HOT_KEY)); + HotKey = AllocateZeroPool(sizeof (BROWSER_HOT_KEY)); ASSERT (HotKey != NULL); HotKey->Signature = BROWSER_HOT_KEY_SIGNATURE; HotKey->KeyData = AllocateCopyPool(sizeof (EFI_INPUT_KEY), KeyData); diff --git a/MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.c b/MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.c index ccd4bdb9b..bd0c0d92b 100644 --- a/MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.c +++ b/MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.c @@ -465,12 +465,12 @@ SmbiosAdd ( // // Allocate internal buffer // - SmbiosEntry = AllocateZeroPool (TotalSize); + SmbiosEntry = AllocateZeroPool(TotalSize); if (SmbiosEntry == NULL) { EfiReleaseLock (&Private->DataLock); return EFI_OUT_OF_RESOURCES; } - HandleEntry = AllocateZeroPool (sizeof(SMBIOS_HANDLE_ENTRY)); + HandleEntry = AllocateZeroPool(sizeof(SMBIOS_HANDLE_ENTRY)); if (HandleEntry == NULL) { EfiReleaseLock (&Private->DataLock); return EFI_OUT_OF_RESOURCES; @@ -715,7 +715,7 @@ SmbiosUpdateString ( // Re-allocate buffer is needed. // NewEntrySize = SmbiosEntry->RecordSize + InputStrLen - TargetStrLen; - ResizedSmbiosEntry = AllocateZeroPool (NewEntrySize); + ResizedSmbiosEntry = AllocateZeroPool(NewEntrySize); if (ResizedSmbiosEntry == NULL) { EfiReleaseLock (&Private->DataLock); diff --git a/MdeModulePkg/Universal/StatusCodeHandler/Smm/MemoryStatusCodeWorker.c b/MdeModulePkg/Universal/StatusCodeHandler/Smm/MemoryStatusCodeWorker.c index c9b43fd24..b1ca82c43 100644 --- a/MdeModulePkg/Universal/StatusCodeHandler/Smm/MemoryStatusCodeWorker.c +++ b/MdeModulePkg/Universal/StatusCodeHandler/Smm/MemoryStatusCodeWorker.c @@ -27,7 +27,7 @@ MemoryStatusCodeInitializeWorker ( // // Allocate SMM memory status code pool. // - mSmmMemoryStatusCodeTable = (RUNTIME_MEMORY_STATUSCODE_HEADER *)AllocateZeroPool (sizeof (RUNTIME_MEMORY_STATUSCODE_HEADER) + PcdGet16 (PcdStatusCodeMemorySize) * 1024); + mSmmMemoryStatusCodeTable = (RUNTIME_MEMORY_STATUSCODE_HEADER *)AllocateZeroPool(sizeof (RUNTIME_MEMORY_STATUSCODE_HEADER) + PcdGet16 (PcdStatusCodeMemorySize) * 1024); ASSERT (mSmmMemoryStatusCodeTable != NULL); mSmmMemoryStatusCodeTable->MaxRecordsNumber = (PcdGet16 (PcdStatusCodeMemorySize) * 1024) / sizeof (MEMORY_STATUSCODE_RECORD); diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Measurement.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/Measurement.c index cf9ac3129..584e4f658 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Measurement.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Measurement.c @@ -100,7 +100,7 @@ MeasureVariable ( VarLogSize = (UINT32)(sizeof (*VarLog) + VarNameLength * sizeof (*VarName) + VarSize - sizeof (VarLog->UnicodeName) - sizeof (VarLog->VariableData)); - VarLog = (UEFI_VARIABLE_DATA *) AllocateZeroPool (VarLogSize); + VarLog = (UEFI_VARIABLE_DATA *) AllocateZeroPool(VarLogSize); if (VarLog == NULL) { return EFI_OUT_OF_RESOURCES; } diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c index ae28d2e1b..840079bdb 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c @@ -137,11 +137,11 @@ UpdateVariableInfo ( // On the first call allocate a entry and place a pointer to it in // the EFI System Table. // - gVariableInfo = AllocateZeroPool (sizeof (VARIABLE_INFO_ENTRY)); + gVariableInfo = AllocateZeroPool(sizeof (VARIABLE_INFO_ENTRY)); ASSERT (gVariableInfo != NULL); CopyGuid (&gVariableInfo->VendorGuid, VendorGuid); - gVariableInfo->Name = AllocateZeroPool (StrSize (VariableName)); + gVariableInfo->Name = AllocateZeroPool(StrSize (VariableName)); ASSERT (gVariableInfo->Name != NULL); StrCpyS (gVariableInfo->Name, StrSize(VariableName)/sizeof(CHAR16), VariableName); gVariableInfo->Volatile = Volatile; @@ -173,11 +173,11 @@ UpdateVariableInfo ( // If the entry is not in the table add it. // Next iteration of the loop will fill in the data. // - Entry->Next = AllocateZeroPool (sizeof (VARIABLE_INFO_ENTRY)); + Entry->Next = AllocateZeroPool(sizeof (VARIABLE_INFO_ENTRY)); ASSERT (Entry->Next != NULL); CopyGuid (&Entry->Next->VendorGuid, VendorGuid); - Entry->Next->Name = AllocateZeroPool (StrSize (VariableName)); + Entry->Next->Name = AllocateZeroPool(StrSize (VariableName)); ASSERT (Entry->Next->Name != NULL); StrCpyS (Entry->Next->Name, StrSize(VariableName)/sizeof(CHAR16), VariableName); Entry->Next->Volatile = Volatile; @@ -1408,7 +1408,7 @@ GetIndexFromSupportedLangCodes( if (Iso639Language) { CompareLength = ISO_639_2_ENTRY_SIZE; - for (Index = 0; Index < AsciiStrLen (SupportedLang); Index += CompareLength) { + for (Index = 0; Index < AsciiStrLen(SupportedLang); Index += CompareLength) { if (AsciiStrnCmp (Lang, SupportedLang + Index, CompareLength) == 0) { // // Successfully find the index of Lang string in SupportedLang string. @@ -1597,7 +1597,7 @@ VariableGetBestLanguage ( // Default to ISO 639-2 mode // CompareLength = 3; - LanguageLength = MIN (3, AsciiStrLen (Language)); + LanguageLength = MIN (3, AsciiStrLen(Language)); // // If in RFC 4646 mode, then determine the length of the first RFC 4646 language code in Language diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c index d97927e03..b10513804 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c @@ -931,7 +931,7 @@ GetVariablePayloadSize ( // SMM_COMMUNICATE_HEADER_SIZE + SMM_VARIABLE_COMMUNICATE_HEADER_SIZE + sizeof (SMM_VARIABLE_COMMUNICATE_GET_PAYLOAD_SIZE); // CommSize = SMM_COMMUNICATE_HEADER_SIZE + SMM_VARIABLE_COMMUNICATE_HEADER_SIZE + sizeof (SMM_VARIABLE_COMMUNICATE_GET_PAYLOAD_SIZE); - CommBuffer = AllocateZeroPool (CommSize); + CommBuffer = AllocateZeroPool(CommSize); if (CommBuffer == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Done; diff --git a/MdePkg/Include/Library/BaseLib.h b/MdePkg/Include/Library/BaseLib.h index b7a8a94bc..32b2ea237 100644 --- a/MdePkg/Include/Library/BaseLib.h +++ b/MdePkg/Include/Library/BaseLib.h @@ -1952,7 +1952,7 @@ AsciiStrnCpy ( **/ UINTN EFIAPI -AsciiStrLen ( +AsciiStrLen( IN CONST CHAR8 *String ); @@ -2590,7 +2590,7 @@ AsciiStrHexToBytes ( string Destination, and returns Destination. The function terminates the Unicode string Destination by appending a Null-terminator character at the end. The caller is responsible to make sure Destination points to a buffer with size - equal or greater than ((AsciiStrLen (Source) + 1) * sizeof (CHAR16)) in bytes. + equal or greater than ((AsciiStrLen(Source) + 1) * sizeof (CHAR16)) in bytes. If Destination is NULL, then ASSERT(). If Destination is not aligned on a 16-bit boundary, then ASSERT(). @@ -2629,7 +2629,7 @@ AsciiStrToUnicodeStr ( appending a Null-terminator character at the end. The caller is responsible to make sure Destination points to a buffer with size - equal or greater than ((AsciiStrLen (Source) + 1) * sizeof (CHAR16)) in bytes. + equal or greater than ((AsciiStrLen(Source) + 1) * sizeof (CHAR16)) in bytes. If Destination is not aligned on a 16-bit boundary, then ASSERT(). If an error would be returned, then the function will also ASSERT(). diff --git a/MdePkg/Include/Library/MemoryAllocationLib.h b/MdePkg/Include/Library/MemoryAllocationLib.h index e1f1b4ae2..c684bb3d4 100644 --- a/MdePkg/Include/Library/MemoryAllocationLib.h +++ b/MdePkg/Include/Library/MemoryAllocationLib.h @@ -263,7 +263,7 @@ AllocateReservedPool ( **/ VOID * EFIAPI -AllocateZeroPool ( +AllocateZeroPool( IN UINTN AllocationSize ); diff --git a/MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c b/MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c index aeeab8573..7cf563464 100644 --- a/MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c +++ b/MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c @@ -129,7 +129,7 @@ DebugPrintMarker ( // // Send the print string to a Serial Port // - SerialPortWrite ((UINT8 *)Buffer, AsciiStrLen (Buffer)); + SerialPortWrite ((UINT8 *)Buffer, AsciiStrLen(Buffer)); } @@ -228,7 +228,7 @@ DebugAssert ( // // Send the print string to the Console Output device // - SerialPortWrite ((UINT8 *)Buffer, AsciiStrLen (Buffer)); + SerialPortWrite ((UINT8 *)Buffer, AsciiStrLen(Buffer)); // // Generate a Breakpoint, DeadLoop, or NOP based on PCD settings diff --git a/MdePkg/Library/BaseLib/SafeString.c b/MdePkg/Library/BaseLib/SafeString.c index 36dc7a4ec..84e9e52d8 100644 --- a/MdePkg/Library/BaseLib/SafeString.c +++ b/MdePkg/Library/BaseLib/SafeString.c @@ -2872,7 +2872,7 @@ UnicodeStrnToAsciiStrS ( appending a Null-terminator character at the end. The caller is responsible to make sure Destination points to a buffer with size - equal or greater than ((AsciiStrLen (Source) + 1) * sizeof (CHAR16)) in bytes. + equal or greater than ((AsciiStrLen(Source) + 1) * sizeof (CHAR16)) in bytes. If Destination is not aligned on a 16-bit boundary, then ASSERT(). If an error would be returned, then the function will also ASSERT(). diff --git a/MdePkg/Library/BaseLib/String.c b/MdePkg/Library/BaseLib/String.c index cf1d62cd0..418f2ed9a 100644 --- a/MdePkg/Library/BaseLib/String.c +++ b/MdePkg/Library/BaseLib/String.c @@ -1083,8 +1083,8 @@ AsciiStrCpy ( // // Destination and source cannot overlap // - ASSERT ((UINTN)(Destination - Source) > AsciiStrLen (Source)); - ASSERT ((UINTN)(Source - Destination) > AsciiStrLen (Source)); + ASSERT ((UINTN)(Destination - Source) > AsciiStrLen(Source)); + ASSERT ((UINTN)(Source - Destination) > AsciiStrLen(Source)); ReturnValue = Destination; while (*Source != 0) { @@ -1149,7 +1149,7 @@ AsciiStrnCpy ( // // Destination and source cannot overlap // - ASSERT ((UINTN)(Destination - Source) > AsciiStrLen (Source)); + ASSERT ((UINTN)(Destination - Source) > AsciiStrLen(Source)); ASSERT ((UINTN)(Source - Destination) >= Length); // if (PcdGet32 (PcdMaximumAsciiStringLength) != 0) { @@ -1189,7 +1189,7 @@ AsciiStrnCpy ( **/ UINTN EFIAPI -AsciiStrLen ( +AsciiStrLen( IN CONST CHAR8 *String ) { @@ -1242,7 +1242,7 @@ AsciiStrSize ( return 0; } - return (AsciiStrLen (String) + 1) * sizeof (*String); + return (AsciiStrLen(String) + 1) * sizeof (*String); } /** @@ -1528,7 +1528,7 @@ AsciiStrCat ( IN CONST CHAR8 *Source ) { - AsciiStrCpy (Destination + AsciiStrLen (Destination), Source); + AsciiStrCpy (Destination + AsciiStrLen(Destination), Source); // // Size of the resulting string should never be zero. @@ -1586,7 +1586,7 @@ AsciiStrnCat ( { UINTN DestinationLen; - DestinationLen = AsciiStrLen (Destination); + DestinationLen = AsciiStrLen(Destination); AsciiStrnCpy (Destination + DestinationLen, Source, Length); Destination[DestinationLen + Length] = '\0'; @@ -1877,7 +1877,7 @@ AsciiStrHexToUint64 ( string Destination, and returns Destination. The function terminates the Unicode string Destination by appending a Null-terminator character at the end. The caller is responsible to make sure Destination points to a buffer with size - equal or greater than ((AsciiStrLen (Source) + 1) * sizeof (CHAR16)) in bytes. + equal or greater than ((AsciiStrLen(Source) + 1) * sizeof (CHAR16)) in bytes. If Destination is NULL, then ASSERT(). If Destination is not aligned on a 16-bit boundary, then ASSERT(). @@ -1921,7 +1921,7 @@ AsciiStrToUnicodeStr ( // // Source and Destination should not overlap // - ASSERT ((UINTN) ((CHAR8 *) Destination - Source) > AsciiStrLen (Source)); + ASSERT ((UINTN) ((CHAR8 *) Destination - Source) > AsciiStrLen(Source)); ASSERT ((UINTN) (Source - (CHAR8 *) Destination) >= (AsciiStrSize (Source) * sizeof (CHAR16))); diff --git a/MdePkg/Library/DxeHstiLib/HstiAip.c b/MdePkg/Library/DxeHstiLib/HstiAip.c index 29675b43f..6e65f791d 100644 --- a/MdePkg/Library/DxeHstiLib/HstiAip.c +++ b/MdePkg/Library/DxeHstiLib/HstiAip.c @@ -104,7 +104,7 @@ HstiAipSetInfo ( HstiAip = HSTI_AIP_PRIVATE_DATA_FROM_THIS(This); if (InformationBlockSize > HstiAip->HstiMaxSize) { - NewHsti = AllocateZeroPool (InformationBlockSize); + NewHsti = AllocateZeroPool(InformationBlockSize); if (NewHsti == NULL) { return EFI_OUT_OF_RESOURCES; } diff --git a/MdePkg/Library/DxeHstiLib/HstiDxe.c b/MdePkg/Library/DxeHstiLib/HstiDxe.c index 1b65a7bf8..eae01b81a 100644 --- a/MdePkg/Library/DxeHstiLib/HstiDxe.c +++ b/MdePkg/Library/DxeHstiLib/HstiDxe.c @@ -286,7 +286,7 @@ HstiLibSetTable ( return EFI_ALREADY_STARTED; } - HstiAip = AllocateZeroPool (sizeof(HSTI_AIP_PRIVATE_DATA)); + HstiAip = AllocateZeroPool(sizeof(HSTI_AIP_PRIVATE_DATA)); if (HstiAip == NULL) { return EFI_OUT_OF_RESOURCES; } diff --git a/MdePkg/Library/DxeRuntimeDebugLibSerialPort/DebugLib.c b/MdePkg/Library/DxeRuntimeDebugLibSerialPort/DebugLib.c index 3a5ae92a3..87a5b42ed 100644 --- a/MdePkg/Library/DxeRuntimeDebugLibSerialPort/DebugLib.c +++ b/MdePkg/Library/DxeRuntimeDebugLibSerialPort/DebugLib.c @@ -189,7 +189,7 @@ DebugPrintMarker ( // // Send the print string to a Serial Port // - SerialPortWrite ((UINT8 *)Buffer, AsciiStrLen (Buffer)); + SerialPortWrite ((UINT8 *)Buffer, AsciiStrLen(Buffer)); } @@ -290,7 +290,7 @@ DebugAssert ( // // Send the print string to the Console Output device // - SerialPortWrite ((UINT8 *)Buffer, AsciiStrLen (Buffer)); + SerialPortWrite ((UINT8 *)Buffer, AsciiStrLen(Buffer)); } // diff --git a/MdePkg/Library/DxeServicesLib/DxeServicesLib.c b/MdePkg/Library/DxeServicesLib/DxeServicesLib.c index 4c16f75ab..6f1fe2d60 100644 --- a/MdePkg/Library/DxeServicesLib/DxeServicesLib.c +++ b/MdePkg/Library/DxeServicesLib/DxeServicesLib.c @@ -1065,7 +1065,7 @@ Done: if (EFI_ERROR(Status)) { *FvFileDevicePath = NULL; } else { - TempFvFileDevicePath = AllocateZeroPool (sizeof (MEDIA_FW_VOL_FILEPATH_DEVICE_PATH) + END_DEVICE_PATH_LENGTH); + TempFvFileDevicePath = AllocateZeroPool(sizeof (MEDIA_FW_VOL_FILEPATH_DEVICE_PATH) + END_DEVICE_PATH_LENGTH); if (TempFvFileDevicePath == NULL) { *FvFileDevicePath = NULL; return EFI_OUT_OF_RESOURCES; diff --git a/MdePkg/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c b/MdePkg/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c index cce26ba0c..5e964f707 100644 --- a/MdePkg/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c +++ b/MdePkg/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c @@ -466,7 +466,7 @@ AllocateReservedPool ( **/ VOID * -InternalAllocateZeroPool ( +InternalAllocateZeroPool( IN EFI_MEMORY_TYPE PoolType, IN UINTN AllocationSize ) @@ -495,7 +495,7 @@ InternalAllocateZeroPool ( **/ VOID * EFIAPI -AllocateZeroPool ( +AllocateZeroPool( IN UINTN AllocationSize ) { @@ -527,7 +527,7 @@ AllocateRuntimeZeroPool ( IN UINTN AllocationSize ) { - return InternalAllocateZeroPool (EfiRuntimeServicesData, AllocationSize); + return InternalAllocateZeroPool(EfiRuntimeServicesData, AllocationSize); } /** @@ -549,7 +549,7 @@ AllocateReservedZeroPool ( IN UINTN AllocationSize ) { - return InternalAllocateZeroPool (EfiReservedMemoryType, AllocationSize); + return InternalAllocateZeroPool(EfiReservedMemoryType, AllocationSize); } /** @@ -710,7 +710,7 @@ InternalReallocatePool ( { VOID *NewBuffer; - NewBuffer = InternalAllocateZeroPool (PoolType, NewSize); + NewBuffer = InternalAllocateZeroPool(PoolType, NewSize); if (NewBuffer != NULL && OldBuffer != NULL) { CopyMem (NewBuffer, OldBuffer, MIN (OldSize, NewSize)); FreePool(OldBuffer); diff --git a/MdePkg/Library/PeiServicesLib/PeiServicesLib.c b/MdePkg/Library/PeiServicesLib/PeiServicesLib.c index b2555c426..18414d6bb 100644 --- a/MdePkg/Library/PeiServicesLib/PeiServicesLib.c +++ b/MdePkg/Library/PeiServicesLib/PeiServicesLib.c @@ -643,14 +643,14 @@ InternalPeiServicesInstallFvInfoPpi ( // // To install FvInfo Ppi. // - FvInfoPpi = AllocateZeroPool (sizeof (EFI_PEI_FIRMWARE_VOLUME_INFO_PPI)); + FvInfoPpi = AllocateZeroPool(sizeof (EFI_PEI_FIRMWARE_VOLUME_INFO_PPI)); ASSERT (FvInfoPpi != NULL); PpiGuid = &gEfiPeiFirmwareVolumeInfoPpiGuid; } else { // // To install FvInfo2 Ppi. // - FvInfoPpi = AllocateZeroPool (sizeof (EFI_PEI_FIRMWARE_VOLUME_INFO2_PPI)); + FvInfoPpi = AllocateZeroPool(sizeof (EFI_PEI_FIRMWARE_VOLUME_INFO2_PPI)); ASSERT (FvInfoPpi != NULL); ((EFI_PEI_FIRMWARE_VOLUME_INFO2_PPI *) FvInfoPpi)->AuthenticationStatus = AuthenticationStatus; PpiGuid = &gEfiPeiFirmwareVolumeInfo2PpiGuid; diff --git a/MdePkg/Library/SmmMemLib/SmmMemLib.c b/MdePkg/Library/SmmMemLib/SmmMemLib.c index 155c999d9..d346dd013 100644 --- a/MdePkg/Library/SmmMemLib/SmmMemLib.c +++ b/MdePkg/Library/SmmMemLib/SmmMemLib.c @@ -394,7 +394,7 @@ SmmMemLibInternalGetGcdMemoryMap ( } } - mSmmMemLibGcdMemSpace = AllocateZeroPool (mSmmMemLibGcdMemNumberOfDesc * sizeof (EFI_GCD_MEMORY_SPACE_DESCRIPTOR)); + mSmmMemLibGcdMemSpace = AllocateZeroPool(mSmmMemLibGcdMemNumberOfDesc * sizeof (EFI_GCD_MEMORY_SPACE_DESCRIPTOR)); ASSERT (mSmmMemLibGcdMemSpace != NULL); if (mSmmMemLibGcdMemSpace == NULL) { mSmmMemLibGcdMemNumberOfDesc = 0; diff --git a/MdePkg/Library/SmmMemoryAllocationLib/MemoryAllocationLib.c b/MdePkg/Library/SmmMemoryAllocationLib/MemoryAllocationLib.c index 3b1ca0841..682205937 100644 --- a/MdePkg/Library/SmmMemoryAllocationLib/MemoryAllocationLib.c +++ b/MdePkg/Library/SmmMemoryAllocationLib/MemoryAllocationLib.c @@ -600,7 +600,7 @@ AllocateReservedPool ( **/ VOID * -InternalAllocateZeroPool ( +InternalAllocateZeroPool( IN EFI_MEMORY_TYPE PoolType, IN UINTN AllocationSize ) @@ -629,11 +629,11 @@ InternalAllocateZeroPool ( **/ VOID * EFIAPI -AllocateZeroPool ( +AllocateZeroPool( IN UINTN AllocationSize ) { - return InternalAllocateZeroPool (EfiRuntimeServicesData, AllocationSize); + return InternalAllocateZeroPool(EfiRuntimeServicesData, AllocationSize); } /** @@ -655,7 +655,7 @@ AllocateRuntimeZeroPool ( IN UINTN AllocationSize ) { - return InternalAllocateZeroPool (EfiRuntimeServicesData, AllocationSize); + return InternalAllocateZeroPool(EfiRuntimeServicesData, AllocationSize); } /** @@ -832,7 +832,7 @@ InternalReallocatePool ( { VOID *NewBuffer; - NewBuffer = InternalAllocateZeroPool (PoolType, NewSize); + NewBuffer = InternalAllocateZeroPool(PoolType, NewSize); if (NewBuffer != NULL && OldBuffer != NULL) { CopyMem (NewBuffer, OldBuffer, MIN (OldSize, NewSize)); FreePool(OldBuffer); diff --git a/MdePkg/Library/SmmPeriodicSmiLib/SmmPeriodicSmiLib.c b/MdePkg/Library/SmmPeriodicSmiLib/SmmPeriodicSmiLib.c index 191ca774b..403969668 100644 --- a/MdePkg/Library/SmmPeriodicSmiLib/SmmPeriodicSmiLib.c +++ b/MdePkg/Library/SmmPeriodicSmiLib/SmmPeriodicSmiLib.c @@ -1092,7 +1092,7 @@ SmmPeriodicSmiLibConstructor ( // // Allocate a buffer for the table of supported periodic SMI tick periods. // - gSmiTickPeriodTable = AllocateZeroPool (Count * sizeof (UINT64)); + gSmiTickPeriodTable = AllocateZeroPool(Count * sizeof (UINT64)); ASSERT (gSmiTickPeriodTable != NULL); // diff --git a/MdePkg/Library/UefiDebugLibDebugPortProtocol/DebugLib.c b/MdePkg/Library/UefiDebugLibDebugPortProtocol/DebugLib.c index 0990af150..dff376a8e 100644 --- a/MdePkg/Library/UefiDebugLibDebugPortProtocol/DebugLib.c +++ b/MdePkg/Library/UefiDebugLibDebugPortProtocol/DebugLib.c @@ -171,7 +171,7 @@ DebugPrintMarker ( // // Send the print string to EFI_DEBUGPORT_PROTOCOL.Write. // - UefiDebugLibDebugPortProtocolWrite (Buffer, AsciiStrLen (Buffer)); + UefiDebugLibDebugPortProtocolWrite (Buffer, AsciiStrLen(Buffer)); } } @@ -282,7 +282,7 @@ DebugAssert ( // // Send the print string to EFI_DEBUGPORT_PROTOCOL.Write. // - UefiDebugLibDebugPortProtocolWrite (Buffer, AsciiStrLen (Buffer)); + UefiDebugLibDebugPortProtocolWrite (Buffer, AsciiStrLen(Buffer)); // // Generate a Breakpoint, DeadLoop, or NOP based on PCD settings diff --git a/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c b/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c index 77344b953..310befd3c 100644 --- a/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c +++ b/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c @@ -424,8 +424,8 @@ DevPathToTextAcpiEx ( AcpiEx = DevPath; HIDStr = (CHAR8 *) (((UINT8 *) AcpiEx) + sizeof (ACPI_EXTENDED_HID_DEVICE_PATH)); - UIDStr = HIDStr + AsciiStrLen (HIDStr) + 1; - CIDStr = UIDStr + AsciiStrLen (UIDStr) + 1; + UIDStr = HIDStr + AsciiStrLen(HIDStr) + 1; + CIDStr = UIDStr + AsciiStrLen(UIDStr) + 1; if (DisplayOnly) { if ((EISA_ID_TO_NUM (AcpiEx->HID) == 0x0A03) || @@ -2448,7 +2448,7 @@ UefiDevicePathLibConvertDevicePathToText ( } if (Str.Str == NULL) { - return AllocateZeroPool (sizeof (CHAR16)); + return AllocateZeroPool(sizeof (CHAR16)); } else { return Str.Str; } diff --git a/MdePkg/Library/UefiDevicePathLib/DevicePathUtilities.c b/MdePkg/Library/UefiDevicePathLib/DevicePathUtilities.c index d304b4787..77ad31445 100644 --- a/MdePkg/Library/UefiDevicePathLib/DevicePathUtilities.c +++ b/MdePkg/Library/UefiDevicePathLib/DevicePathUtilities.c @@ -752,7 +752,7 @@ UefiDevicePathLibCreateDeviceNode ( return NULL; } - DevicePath = AllocateZeroPool (NodeLength); + DevicePath = AllocateZeroPool(NodeLength); if (DevicePath != NULL) { DevicePath->Type = NodeType; DevicePath->SubType = NodeSubType; diff --git a/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c b/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c index 9eb274ec7..f24a56d83 100644 --- a/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c +++ b/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c @@ -1195,7 +1195,7 @@ FileHandlePrintLine( // // Get a buffer to print into // - Buffer = AllocateZeroPool (PcdGet16 (PcdUefiFileHandleLibPrintBufferSize)); + Buffer = AllocateZeroPool(PcdGet16 (PcdUefiFileHandleLibPrintBufferSize)); if (Buffer == NULL) { return (EFI_OUT_OF_RESOURCES); } diff --git a/MdePkg/Library/UefiLib/Console.c b/MdePkg/Library/UefiLib/Console.c index aff32aece..8ba00f1a3 100644 --- a/MdePkg/Library/UefiLib/Console.c +++ b/MdePkg/Library/UefiLib/Console.c @@ -473,7 +473,7 @@ CreatePopUp ( // // Allocate a buffer for a single line of the popup with borders and a Null-terminator // - Line = AllocateZeroPool ((MaxLength + 3) * sizeof (CHAR16)); + Line = AllocateZeroPool((MaxLength + 3) * sizeof (CHAR16)); ASSERT (Line != NULL); // @@ -509,7 +509,7 @@ CreatePopUp ( // Length > MaxLength // UefiLibGetStringWidth (String, TRUE, MaxLength, &Length); - TmpString = AllocateZeroPool ((Length + 1) * sizeof (CHAR16)); + TmpString = AllocateZeroPool((Length + 1) * sizeof (CHAR16)); ASSERT (TmpString != NULL); StrnCpyS (TmpString, Length + 1, String, Length - 3); StrCatS (TmpString, Length + 1, L"..."); diff --git a/MdePkg/Library/UefiLib/UefiLib.c b/MdePkg/Library/UefiLib/UefiLib.c index 340155058..fa324e8d7 100644 --- a/MdePkg/Library/UefiLib/UefiLib.c +++ b/MdePkg/Library/UefiLib/UefiLib.c @@ -1649,7 +1649,7 @@ GetBestLanguage ( // Default to ISO 639-2 mode // CompareLength = 3; - LanguageLength = MIN (3, AsciiStrLen (Language)); + LanguageLength = MIN (3, AsciiStrLen(Language)); // // If in RFC 4646 mode, then determine the length of the first RFC 4646 language code in Language @@ -1693,7 +1693,7 @@ GetBestLanguage ( // // Allocate, copy, and return the best matching language code from SupportedLanguages // - BestLanguage = AllocateZeroPool (CompareLength + 1); + BestLanguage = AllocateZeroPool(CompareLength + 1); if (BestLanguage == NULL) { return NULL; } diff --git a/MdePkg/Library/UefiLib/UefiLibPrint.c b/MdePkg/Library/UefiLib/UefiLibPrint.c index 637cf9402..3754ec0a0 100644 --- a/MdePkg/Library/UefiLib/UefiLibPrint.c +++ b/MdePkg/Library/UefiLib/UefiLibPrint.c @@ -432,7 +432,7 @@ InternalPrintGraphic ( goto Error; } - Blt = (EFI_IMAGE_OUTPUT *) AllocateZeroPool (sizeof (EFI_IMAGE_OUTPUT)); + Blt = (EFI_IMAGE_OUTPUT *) AllocateZeroPool(sizeof (EFI_IMAGE_OUTPUT)); ASSERT (Blt != NULL); if (!Blt) { return 0; @@ -493,7 +493,7 @@ InternalPrintGraphic ( goto Error; } - Blt->Image.Bitmap = AllocateZeroPool ((UINT32) Blt->Width * Blt->Height * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)); + Blt->Image.Bitmap = AllocateZeroPool((UINT32) Blt->Width * Blt->Height * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)); ASSERT (Blt->Image.Bitmap != NULL); if (!Blt->Image.Bitmap) { return 0; diff --git a/MdePkg/Library/UefiMemoryAllocationLib/MemoryAllocationLib.c b/MdePkg/Library/UefiMemoryAllocationLib/MemoryAllocationLib.c index 987416cea..b1323c7cd 100644 --- a/MdePkg/Library/UefiMemoryAllocationLib/MemoryAllocationLib.c +++ b/MdePkg/Library/UefiMemoryAllocationLib/MemoryAllocationLib.c @@ -479,7 +479,7 @@ AllocateReservedPool ( **/ VOID * -InternalAllocateZeroPool ( +InternalAllocateZeroPool( IN EFI_MEMORY_TYPE PoolType, IN UINTN AllocationSize ) @@ -508,11 +508,11 @@ InternalAllocateZeroPool ( **/ VOID * EFIAPI -AllocateZeroPool ( +AllocateZeroPool( IN UINTN AllocationSize ) { - return InternalAllocateZeroPool (EfiBootServicesData, AllocationSize); + return InternalAllocateZeroPool(EfiBootServicesData, AllocationSize); } /** @@ -534,7 +534,7 @@ AllocateRuntimeZeroPool ( IN UINTN AllocationSize ) { - return InternalAllocateZeroPool (EfiRuntimeServicesData, AllocationSize); + return InternalAllocateZeroPool(EfiRuntimeServicesData, AllocationSize); } /** @@ -556,7 +556,7 @@ AllocateReservedZeroPool ( IN UINTN AllocationSize ) { - return InternalAllocateZeroPool (EfiReservedMemoryType, AllocationSize); + return InternalAllocateZeroPool(EfiReservedMemoryType, AllocationSize); } /** @@ -714,7 +714,7 @@ InternalReallocatePool ( { VOID *NewBuffer; - NewBuffer = InternalAllocateZeroPool (PoolType, NewSize); + NewBuffer = InternalAllocateZeroPool(PoolType, NewSize); if (NewBuffer != NULL && OldBuffer != NULL) { CopyMem (NewBuffer, OldBuffer, MIN (OldSize, NewSize)); FreePool(OldBuffer); diff --git a/MdePkg/Library/UefiScsiLib/UefiScsiLib.c b/MdePkg/Library/UefiScsiLib/UefiScsiLib.c index 3e0f5450c..4af075bb7 100644 --- a/MdePkg/Library/UefiScsiLib/UefiScsiLib.c +++ b/MdePkg/Library/UefiScsiLib/UefiScsiLib.c @@ -1441,12 +1441,12 @@ ScsiRead10CommandEx ( ASSERT (DataLength != NULL); ASSERT (ScsiIo != NULL); - Context = AllocateZeroPool (sizeof (EFI_SCSI_LIB_ASYNC_CONTEXT)); + Context = AllocateZeroPool(sizeof (EFI_SCSI_LIB_ASYNC_CONTEXT)); if (Context == NULL) { return EFI_OUT_OF_RESOURCES; } - Cdb = AllocateZeroPool (EFI_SCSI_OP_LENGTH_TEN); + Cdb = AllocateZeroPool(EFI_SCSI_OP_LENGTH_TEN); if (Cdb == NULL) { Status = EFI_OUT_OF_RESOURCES; goto ErrorExit; @@ -1625,12 +1625,12 @@ ScsiWrite10CommandEx ( ASSERT (DataLength != NULL); ASSERT (ScsiIo != NULL); - Context = AllocateZeroPool (sizeof (EFI_SCSI_LIB_ASYNC_CONTEXT)); + Context = AllocateZeroPool(sizeof (EFI_SCSI_LIB_ASYNC_CONTEXT)); if (Context == NULL) { return EFI_OUT_OF_RESOURCES; } - Cdb = AllocateZeroPool (EFI_SCSI_OP_LENGTH_TEN); + Cdb = AllocateZeroPool(EFI_SCSI_OP_LENGTH_TEN); if (Cdb == NULL) { Status = EFI_OUT_OF_RESOURCES; goto ErrorExit; @@ -1809,12 +1809,12 @@ ScsiRead16CommandEx ( ASSERT (DataLength != NULL); ASSERT (ScsiIo != NULL); - Context = AllocateZeroPool (sizeof (EFI_SCSI_LIB_ASYNC_CONTEXT)); + Context = AllocateZeroPool(sizeof (EFI_SCSI_LIB_ASYNC_CONTEXT)); if (Context == NULL) { return EFI_OUT_OF_RESOURCES; } - Cdb = AllocateZeroPool (EFI_SCSI_OP_LENGTH_SIXTEEN); + Cdb = AllocateZeroPool(EFI_SCSI_OP_LENGTH_SIXTEEN); if (Cdb == NULL) { Status = EFI_OUT_OF_RESOURCES; goto ErrorExit; @@ -1993,12 +1993,12 @@ ScsiWrite16CommandEx ( ASSERT (DataLength != NULL); ASSERT (ScsiIo != NULL); - Context = AllocateZeroPool (sizeof (EFI_SCSI_LIB_ASYNC_CONTEXT)); + Context = AllocateZeroPool(sizeof (EFI_SCSI_LIB_ASYNC_CONTEXT)); if (Context == NULL) { return EFI_OUT_OF_RESOURCES; } - Cdb = AllocateZeroPool (EFI_SCSI_OP_LENGTH_SIXTEEN); + Cdb = AllocateZeroPool(EFI_SCSI_OP_LENGTH_SIXTEEN); if (Cdb == NULL) { Status = EFI_OUT_OF_RESOURCES; goto ErrorExit; diff --git a/MemoryFix/AptioMemoryFix/BootArgs.c b/MemoryFix/AptioMemoryFix/BootArgs.c index 0c5029d07..b16390121 100644 --- a/MemoryFix/AptioMemoryFix/BootArgs.c +++ b/MemoryFix/AptioMemoryFix/BootArgs.c @@ -129,7 +129,7 @@ AppendArgumentToCommandLine ( IN CONST UINTN ArgumentLength ) { - UINTN Len = AsciiStrLen (CommandLine); + UINTN Len = AsciiStrLen(CommandLine); // // Account for extra space. diff --git a/MemoryFix/AptioMemoryFix/CustomSlide.c b/MemoryFix/AptioMemoryFix/CustomSlide.c index c9b5c03e6..6301e413f 100644 --- a/MemoryFix/AptioMemoryFix/CustomSlide.c +++ b/MemoryFix/AptioMemoryFix/CustomSlide.c @@ -419,7 +419,7 @@ GetVariableBootArgs ( AsciiStrnCpyS (mStoredBootArgsVar, SlideArgumentLength + 1, SlideArgument, SlideArgumentLength + 1);; } - mStoredBootArgsVarSize = AsciiStrLen (mStoredBootArgsVar) + 1; + mStoredBootArgsVarSize = AsciiStrLen(mStoredBootArgsVar) + 1; mStoredBootArgsVarSet = TRUE; } diff --git a/Protocols/AppleKeyAggregator/AppleKeyAggregator.c b/Protocols/AppleKeyAggregator/AppleKeyAggregator.c index c114e6ec8..016f6acf3 100644 --- a/Protocols/AppleKeyAggregator/AppleKeyAggregator.c +++ b/Protocols/AppleKeyAggregator/AppleKeyAggregator.c @@ -129,12 +129,12 @@ KeyMapCreateKeyStrokesBuffer ( BufferSize = (Aggregator->KeyBuffersSize + KeyBufferSize); Aggregator->KeyBuffersSize = BufferSize; - Memory = AllocateZeroPool (BufferSize); + Memory = AllocateZeroPool(BufferSize); Aggregator->KeyBuffer = Memory; Status = EFI_OUT_OF_RESOURCES; if (Memory != NULL) { - KeyStrokesInfo = AllocateZeroPool (sizeof (APPLE_KEY_STROKES_INFO) + KeyStrokesInfo = AllocateZeroPool(sizeof (APPLE_KEY_STROKES_INFO) + (KeyBufferSize * sizeof (APPLE_KEY))); Status = EFI_OUT_OF_RESOURCES; diff --git a/Protocols/DataHubDxe/DataHub.c b/Protocols/DataHubDxe/DataHub.c index f37236148..278ca9246 100644 --- a/Protocols/DataHubDxe/DataHub.c +++ b/Protocols/DataHubDxe/DataHub.c @@ -431,7 +431,7 @@ DataHubRegisterFilterDriver ( Private = DATA_HUB_INSTANCE_FROM_THIS (This); - FilterDriver = (DATA_HUB_FILTER_DRIVER *) AllocateZeroPool (sizeof (DATA_HUB_FILTER_DRIVER)); + FilterDriver = (DATA_HUB_FILTER_DRIVER *) AllocateZeroPool(sizeof (DATA_HUB_FILTER_DRIVER)); if (FilterDriver == NULL) { return EFI_OUT_OF_RESOURCES; } diff --git a/Protocols/EmuVariableUefi/EmuVariable.c b/Protocols/EmuVariableUefi/EmuVariable.c index 84d76a3b0..9bb574610 100644 --- a/Protocols/EmuVariableUefi/EmuVariable.c +++ b/Protocols/EmuVariableUefi/EmuVariable.c @@ -319,11 +319,11 @@ UpdateVariableInfo ( // on the first call allocate a entry and place a pointer to it in // the EFI System Table // - gVariableInfo = AllocateZeroPool (sizeof (VARIABLE_INFO_ENTRY)); + gVariableInfo = AllocateZeroPool(sizeof (VARIABLE_INFO_ENTRY)); // ASSERT (gVariableInfo != NULL); CopyGuid (&gVariableInfo->VendorGuid, VendorGuid); - gVariableInfo->Name = AllocateZeroPool (StrSize (VariableName)); + gVariableInfo->Name = AllocateZeroPool(StrSize (VariableName)); // ASSERT (gVariableInfo->Name != NULL); StrnCpyS (gVariableInfo->Name, StrLen(VariableName)+1, VariableName, StrLen (VariableName)); gVariableInfo->Volatile = Volatile; @@ -357,11 +357,11 @@ UpdateVariableInfo ( // If the entry is not in the table add it. // Next iteration of the loop will fill in the data // - Entry->Next = AllocateZeroPool (sizeof (VARIABLE_INFO_ENTRY)); + Entry->Next = AllocateZeroPool(sizeof (VARIABLE_INFO_ENTRY)); // ASSERT (Entry->Next != NULL); CopyGuid (&Entry->Next->VendorGuid, VendorGuid); - Entry->Next->Name = AllocateZeroPool (StrSize (VariableName)); + Entry->Next->Name = AllocateZeroPool(StrSize (VariableName)); // ASSERT (Entry->Next->Name != NULL); StrnCpyS (Entry->Next->Name, StrLen(VariableName)+1, VariableName, StrLen(VariableName)); Entry->Next->Volatile = Volatile; @@ -410,7 +410,7 @@ GetIndexFromSupportedLangCodes( if (Iso639Language) { CompareLength = ISO_639_2_ENTRY_SIZE; - for (Index = 0; Index < AsciiStrLen (SupportedLang); Index += CompareLength) { + for (Index = 0; Index < AsciiStrLen(SupportedLang); Index += CompareLength) { if (AsciiStrnCmp (Lang, SupportedLang + Index, CompareLength) == 0) { // // Successfully find the index of Lang string in SupportedLang string. @@ -598,7 +598,7 @@ VariableGetBestLanguage ( // Default to ISO 639-2 mode // CompareLength = 3; - LanguageLength = MIN (3, AsciiStrLen (Language)); + LanguageLength = MIN (3, AsciiStrLen(Language)); // // If in RFC 4646 mode, then determine the length of the first RFC 4646 language code in Language diff --git a/Protocols/EmuVariableUefi/InitVariable.c b/Protocols/EmuVariableUefi/InitVariable.c index ef3528075..fd1b7978b 100644 --- a/Protocols/EmuVariableUefi/InitVariable.c +++ b/Protocols/EmuVariableUefi/InitVariable.c @@ -284,13 +284,13 @@ CopyRTVariables ( // First call to GetNextVariableName is with L"\0" // NameSize = 512; - Name = AllocateZeroPool (NameSize); + Name = AllocateZeroPool(NameSize); // // Initial Data buffer // DataSize = 512; - Data = AllocateZeroPool (DataSize); + Data = AllocateZeroPool(DataSize); while (TRUE) { // diff --git a/rEFIt_UEFI/Platform/AmlGenerator.cpp b/rEFIt_UEFI/Platform/AmlGenerator.cpp index d5fdddef8..6994af3c0 100644 --- a/rEFIt_UEFI/Platform/AmlGenerator.cpp +++ b/rEFIt_UEFI/Platform/AmlGenerator.cpp @@ -91,7 +91,7 @@ AML_CHUNK* aml_add_buffer(AML_CHUNK* parent, CONST UINT8* buffer, UINT32 size) { node->Type = AML_CHUNK_NONE; node->Length = (UINT16)size; - node->Buffer = (__typeof__(node->Buffer))AllocateZeroPool (node->Length); + node->Buffer = (__typeof__(node->Buffer))AllocateZeroPool(node->Length); CopyMem(node->Buffer, buffer, node->Length); } @@ -107,7 +107,7 @@ AML_CHUNK* aml_add_byte(AML_CHUNK* parent, UINT8 value) node->Type = AML_CHUNK_BYTE; node->Length = 1; - node->Buffer = (__typeof__(node->Buffer))AllocateZeroPool (node->Length); + node->Buffer = (__typeof__(node->Buffer))AllocateZeroPool(node->Length); node->Buffer[0] = value; } @@ -122,7 +122,7 @@ AML_CHUNK* aml_add_word(AML_CHUNK* parent, UINT16 value) { node->Type = AML_CHUNK_WORD; node->Length = 2; - node->Buffer = (__typeof__(node->Buffer))AllocateZeroPool (node->Length); + node->Buffer = (__typeof__(node->Buffer))AllocateZeroPool(node->Length); node->Buffer[0] = value & 0xff; node->Buffer[1] = value >> 8; } @@ -138,7 +138,7 @@ AML_CHUNK* aml_add_dword(AML_CHUNK* parent, UINT32 value) { node->Type = AML_CHUNK_DWORD; node->Length = 4; - node->Buffer = (__typeof__(node->Buffer))AllocateZeroPool (node->Length); + node->Buffer = (__typeof__(node->Buffer))AllocateZeroPool(node->Length); node->Buffer[0] = value & 0xff; node->Buffer[1] = (value >> 8) & 0xff; node->Buffer[2] = (value >> 16) & 0xff; @@ -156,7 +156,7 @@ AML_CHUNK* aml_add_qword(AML_CHUNK* parent, UINT64 value) { node->Type = AML_CHUNK_QWORD; node->Length = 8; - node->Buffer = (__typeof__(node->Buffer))AllocateZeroPool (node->Length); + node->Buffer = (__typeof__(node->Buffer))AllocateZeroPool(node->Length); node->Buffer[0] = value & 0xff; node->Buffer[1] = RShiftU64(value, 8) & 0xff; node->Buffer[2] = RShiftU64(value, 16) & 0xff; @@ -206,7 +206,7 @@ UINT32 aml_fill_name(AML_CHUNK* node, CONST CHAR8* name) if (count == 1) { node->Length = (UINT16)(4 + root); - node->Buffer = (__typeof__(node->Buffer))AllocateZeroPool (node->Length+4); + node->Buffer = (__typeof__(node->Buffer))AllocateZeroPool(node->Length+4); CopyMem(node->Buffer, name, 4 + root); offset += 4 + root; return (UINT32)offset; @@ -215,7 +215,7 @@ UINT32 aml_fill_name(AML_CHUNK* node, CONST CHAR8* name) if (count == 2) { node->Length = 2 + 8; - node->Buffer = (__typeof__(node->Buffer))AllocateZeroPool (node->Length+4); + node->Buffer = (__typeof__(node->Buffer))AllocateZeroPool(node->Length+4); node->Buffer[offset++] = 0x5c; // Root Char node->Buffer[offset++] = 0x2e; // Double name CopyMem(node->Buffer+offset, name + root, 8); @@ -224,7 +224,7 @@ UINT32 aml_fill_name(AML_CHUNK* node, CONST CHAR8* name) } node->Length = (UINT16)(3 + (count << 2)); - node->Buffer = (__typeof__(node->Buffer))AllocateZeroPool (node->Length+4); + node->Buffer = (__typeof__(node->Buffer))AllocateZeroPool(node->Length+4); node->Buffer[offset++] = 0x5c; // Root Char node->Buffer[offset++] = 0x2f; // Multi name node->Buffer[offset++] = (CHAR8)count; // Names count @@ -288,7 +288,7 @@ AML_CHUNK* aml_add_package(AML_CHUNK* parent) node->Type = AML_CHUNK_PACKAGE; node->Length = 1; - node->Buffer = (__typeof__(node->Buffer))AllocateZeroPool (node->Length); + node->Buffer = (__typeof__(node->Buffer))AllocateZeroPool(node->Length); } return node; @@ -303,7 +303,7 @@ AML_CHUNK* aml_add_alias(AML_CHUNK* parent, /* CONST*/ CHAR8* name1, /* CONST*/ node->Type = AML_CHUNK_ALIAS; node->Length = 8; - node->Buffer = (__typeof__(node->Buffer))AllocateZeroPool (node->Length); + node->Buffer = (__typeof__(node->Buffer))AllocateZeroPool(node->Length); aml_fill_simple_name(node->Buffer, name1); aml_fill_simple_name(node->Buffer+4, name2); } @@ -385,7 +385,7 @@ AML_CHUNK* aml_add_byte_buffer(AML_CHUNK* parent, /* CONST*/ UINT8* data, UINT32 INTN offset=0; node->Type = AML_CHUNK_BUFFER; node->Length = (UINT8)(size + 2); - node->Buffer = (__typeof__(node->Buffer))AllocateZeroPool (node->Length); + node->Buffer = (__typeof__(node->Buffer))AllocateZeroPool(node->Length); node->Buffer[offset++] = AML_CHUNK_BYTE; //0x0A node->Buffer[offset++] = (CHAR8)size; CopyMem(node->Buffer+offset, data, node->Length); @@ -404,7 +404,7 @@ AML_CHUNK* aml_add_string_buffer(AML_CHUNK* parent, CONST CHAR8* StringBuf) UINTN len = AsciiStrLen(StringBuf); node->Type = AML_CHUNK_BUFFER; node->Length = (UINT8)(len + 3); - node->Buffer = (__typeof__(node->Buffer))AllocateZeroPool (node->Length); + node->Buffer = (__typeof__(node->Buffer))AllocateZeroPool(node->Length); node->Buffer[offset++] = AML_CHUNK_BYTE; node->Buffer[offset++] = (CHAR8)(len + 1); CopyMem(node->Buffer+offset, StringBuf, len); @@ -423,7 +423,7 @@ AML_CHUNK* aml_add_string(AML_CHUNK* parent, CONST CHAR8* StringBuf) INTN len = AsciiStrLen(StringBuf); node->Type = AML_CHUNK_STRING; node->Length = (UINT8)(len + 1); - node->Buffer = (__typeof__(node->Buffer))AllocateZeroPool (len + 1); + node->Buffer = (__typeof__(node->Buffer))AllocateZeroPool(len + 1); CopyMem(node->Buffer, StringBuf, len); // node->Buffer[len] = '\0'; } diff --git a/rEFIt_UEFI/Platform/BootOptions.cpp b/rEFIt_UEFI/Platform/BootOptions.cpp index 67876e8ff..17f0282be 100644 --- a/rEFIt_UEFI/Platform/BootOptions.cpp +++ b/rEFIt_UEFI/Platform/BootOptions.cpp @@ -355,7 +355,7 @@ GetBootOrder ( // // Get gEfiGlobalVariableGuid:BootOrder and it's length // - *BootOrder = (__typeof_am__(*BootOrder))GetNvramVariable (BOOT_ORDER_VAR, &gEfiGlobalVariableGuid, NULL, &BootOrderSize); + *BootOrder = (__typeof_am__(*BootOrder))GetNvramVariable(BOOT_ORDER_VAR, &gEfiGlobalVariableGuid, NULL, &BootOrderSize); if (*BootOrder == NULL) { DBG(" EFI_NOT_FOUND\n"); return EFI_NOT_FOUND; @@ -397,7 +397,7 @@ AddToBootOrder ( // // Make new order buffer with space for our option // - BootOrderNew = (__typeof__(BootOrderNew))AllocateZeroPool ((BootOrderLen + 1) * sizeof(UINT16)); + BootOrderNew = (__typeof__(BootOrderNew))AllocateZeroPool((BootOrderLen + 1) * sizeof(UINT16)); if (BootOrderNew == NULL) { DBG("AddToBootOrder: EFI_OUT_OF_RESOURCES\n"); if (BootOrder) { @@ -651,7 +651,7 @@ CompileBootOption ( + BootOption->DescriptionSize + BootOption->FilePathListLength + BootOption->OptionalDataSize; - BootOption->Variable = (__typeof__(BootOption->Variable))AllocateZeroPool (BootOption->VariableSize); + BootOption->Variable = (__typeof__(BootOption->Variable))AllocateZeroPool(BootOption->VariableSize); if (BootOption->Variable == NULL) { DBG("CompileBootOption: EFI_OUT_OF_RESOURCES\n"); return EFI_OUT_OF_RESOURCES; @@ -701,7 +701,7 @@ GetBootOption ( BootOption->BootNum = BootNum; snwprintf(VarName, sizeof(VarName), "Boot%04hX", BootNum); - BootOption->Variable = (__typeof__(BootOption->Variable))GetNvramVariable (VarName, &gEfiGlobalVariableGuid, NULL, (UINTN *)(UINTN)(OFFSET_OF(BO_BOOT_OPTION, VariableSize) + (UINTN)BootOption)); + BootOption->Variable = (__typeof__(BootOption->Variable))GetNvramVariable(VarName, &gEfiGlobalVariableGuid, NULL, (UINTN *)(UINTN)(OFFSET_OF(BO_BOOT_OPTION, VariableSize) + (UINTN)BootOption)); if (BootOption->Variable == NULL) { return EFI_NOT_FOUND; } diff --git a/rEFIt_UEFI/Platform/DevicePath.cpp b/rEFIt_UEFI/Platform/DevicePath.cpp index dd400ba84..73e7d9d8a 100644 --- a/rEFIt_UEFI/Platform/DevicePath.cpp +++ b/rEFIt_UEFI/Platform/DevicePath.cpp @@ -42,7 +42,7 @@ // VA_LIST Args; // UINTN StringSize; // -// AppendStr = (__typeof__(AppendStr))AllocateZeroPool (0x1000); +// AppendStr = (__typeof__(AppendStr))AllocateZeroPool(0x1000); // if (AppendStr == NULL) { // return Str->Str; // } @@ -52,7 +52,7 @@ // VA_END (Args); // if (NULL == Str->Str) { // StringSize = StrSize (AppendStr); -// Str->Str = (__typeof__(Str->Str))AllocateZeroPool (StringSize); +// Str->Str = (__typeof__(Str->Str))AllocateZeroPool(StringSize); //// ASSERT (Str->Str != NULL); // } else { // StringSize = StrSize (AppendStr); diff --git a/rEFIt_UEFI/Platform/Nvram.cpp b/rEFIt_UEFI/Platform/Nvram.cpp index 5b54907f7..fce047692 100644 --- a/rEFIt_UEFI/Platform/Nvram.cpp +++ b/rEFIt_UEFI/Platform/Nvram.cpp @@ -93,7 +93,7 @@ GetEfiTimeInMs ( } /** Reads and returns value of NVRAM variable. */ -VOID *GetNvramVariable ( +VOID *GetNvramVariable( IN CONST CHAR16 *VariableName, IN EFI_GUID *VendorGuid, OUT UINT32 *Attributes OPTIONAL, @@ -115,7 +115,7 @@ VOID *GetNvramVariable ( // // Allocate the buffer to return // - Data = (__typeof__(Data))AllocateZeroPool (IntDataSize + 1); + Data = (__typeof__(Data))AllocateZeroPool(IntDataSize + 1); if (Data != NULL) { // // Read variable into the allocated buffer. @@ -151,7 +151,7 @@ SetNvramVariable ( UINT32 OldAttributes = 0; //DBG("SetNvramVariable (%ls, guid, 0x%X, %d):", VariableName, Attributes, DataSize); - OldData = (__typeof__(OldData))GetNvramVariable (VariableName, VendorGuid, &OldAttributes, &OldDataSize); + OldData = (__typeof__(OldData))GetNvramVariable(VariableName, VendorGuid, &OldAttributes, &OldDataSize); if (OldData != NULL) { // var already exists - check if it equal to new value //DBG(" exists(0x%X, %d)", OldAttributes, OldDataSize); @@ -194,7 +194,7 @@ AddNvramVariable ( VOID *OldData; //DBG("SetNvramVariable (%ls, guid, 0x%X, %d):\n", VariableName, Attributes, DataSize); - OldData = (__typeof__(OldData))GetNvramVariable (VariableName, VendorGuid, NULL, NULL); + OldData = (__typeof__(OldData))GetNvramVariable(VariableName, VendorGuid, NULL, NULL); if (OldData == NULL) { // set new value @@ -288,7 +288,7 @@ ResetNativeNvram () //DbgHeader("ResetNativeNvram: cleanup NVRAM variables"); NameSize = sizeof (CHAR16); - Name = (__typeof__(Name))AllocateZeroPool (NameSize); + Name = (__typeof__(Name))AllocateZeroPool(NameSize); if (Name == NULL) { return Status; } @@ -417,7 +417,7 @@ GetSmcKeys (BOOLEAN WriteToSMC) NameSize = sizeof (CHAR16); - Name = (__typeof__(Name))AllocateZeroPool (NameSize); + Name = (__typeof__(Name))AllocateZeroPool(NameSize); if (Name == NULL) { return; } @@ -451,7 +451,7 @@ GetSmcKeys (BOOLEAN WriteToSMC) continue; //the variable is not interesting for us } - Data = (__typeof__(Data))GetNvramVariable (Name, &Guid, NULL, &DataSize); + Data = (__typeof__(Data))GetNvramVariable(Name, &Guid, NULL, &DataSize); if (Data) { /* UINTN Index; DBG(" %ls:", Name); @@ -715,7 +715,7 @@ GetEfiBootDeviceFromNvram () return EFI_SUCCESS; } - gEfiBootDeviceData = (__typeof__(gEfiBootDeviceData))GetNvramVariable (L"efi-boot-next-data", &gEfiAppleBootGuid, NULL, &Size); + gEfiBootDeviceData = (__typeof__(gEfiBootDeviceData))GetNvramVariable(L"efi-boot-next-data", &gEfiAppleBootGuid, NULL, &Size); if (gEfiBootDeviceData != NULL) { // DBG("Got efi-boot-next-data size=%d\n", Size); if (IsDevicePathValid(gEfiBootDeviceData, Size)) { @@ -732,9 +732,9 @@ GetEfiBootDeviceFromNvram () EFI_STATUS Status; Status = GetVariable2 (L"aptiofixflag", &gEfiAppleBootGuid, &Value, &Size2); if (EFI_ERROR(Status)) { - gEfiBootDeviceData = (__typeof__(gEfiBootDeviceData))GetNvramVariable (L"efi-boot-device-data", &gEfiAppleBootGuid, NULL, &Size); + gEfiBootDeviceData = (__typeof__(gEfiBootDeviceData))GetNvramVariable(L"efi-boot-device-data", &gEfiAppleBootGuid, NULL, &Size); } else { - gEfiBootDeviceData = (__typeof__(gEfiBootDeviceData))GetNvramVariable (L"specialbootdevice", &gEfiAppleBootGuid, NULL, &Size); + gEfiBootDeviceData = (__typeof__(gEfiBootDeviceData))GetNvramVariable(L"specialbootdevice", &gEfiAppleBootGuid, NULL, &Size); } if (gEfiBootDeviceData != NULL) { @@ -761,7 +761,7 @@ GetEfiBootDeviceFromNvram () // then Startup Disk sets BootCampHD to Win disk dev path. // if (DevicePathType(gEfiBootDeviceData) == HARDWARE_DEVICE_PATH && DevicePathSubType (gEfiBootDeviceData) == HW_MEMMAP_DP) { - gBootCampHD = (__typeof__(gBootCampHD))GetNvramVariable (L"BootCampHD", &gEfiAppleBootGuid, NULL, &Size); + gBootCampHD = (__typeof__(gBootCampHD))GetNvramVariable(L"BootCampHD", &gEfiAppleBootGuid, NULL, &Size); gEfiBootVolume = gBootCampHD; if (gBootCampHD == NULL) { @@ -1016,7 +1016,7 @@ PutNvramPlistToRtVars () } // key to unicode; check if key buffer is large enough - if (AsciiStrLen (Tag->string) > (sizeof(KeyBuf) / 2 - 1)) { + if (AsciiStrLen(Tag->string) > (sizeof(KeyBuf) / 2 - 1)) { DBG(" ERROR: Skipping too large key %s\n", Tag->string); continue; } @@ -1375,10 +1375,10 @@ EFI_STATUS SetStartupDiskVolume ( // "" // ""; // -// Size = AsciiStrLen (EfiBootDeviceTmpl) + 36; -// EfiBootDevice = (__typeof__(EfiBootDevice))AllocateZeroPool(AsciiStrLen (EfiBootDeviceTmpl) + 36); +// Size = AsciiStrLen(EfiBootDeviceTmpl) + 36; +// EfiBootDevice = (__typeof__(EfiBootDevice))AllocateZeroPool(AsciiStrLen(EfiBootDeviceTmpl) + 36); // AsciiSPrint (EfiBootDevice, Size, EfiBootDeviceTmpl, strguid(Guid)); -// Size = AsciiStrLen (EfiBootDevice); +// Size = AsciiStrLen(EfiBootDevice); // DBG(" * efi-boot-device: %s\n", EfiBootDevice); // // Status = SetNvramVariable (L"efi-boot-device", &gEfiAppleBootGuid, Attributes, Size, EfiBootDevice); diff --git a/rEFIt_UEFI/Platform/Nvram.h b/rEFIt_UEFI/Platform/Nvram.h index 0fb4cc9b9..eced8e7b8 100644 --- a/rEFIt_UEFI/Platform/Nvram.h +++ b/rEFIt_UEFI/Platform/Nvram.h @@ -24,7 +24,7 @@ FindStartupDiskVolume ( ); VOID -*GetNvramVariable ( +*GetNvramVariable( IN CONST CHAR16 *VariableName, IN EFI_GUID *VendorGuid, OUT UINT32 *Attributes OPTIONAL, diff --git a/rEFIt_UEFI/Platform/Posix/strlen.cpp b/rEFIt_UEFI/Platform/Posix/strlen.cpp index f0ce9c153..3fad5874c 100755 --- a/rEFIt_UEFI/Platform/Posix/strlen.cpp +++ b/rEFIt_UEFI/Platform/Posix/strlen.cpp @@ -6,7 +6,7 @@ #include // for SIZE_T_MAX #ifdef MAP_TO_EDK_STRLEN -extern "C" UINTN EFIAPI AsciiStrLen (IN CONST CHAR8 *String); +extern "C" UINTN EFIAPI AsciiStrLen(IN CONST CHAR8 *String); #endif // Hope that unsigned long long is as big in bits sa a pointer difference. diff --git a/rEFIt_UEFI/Platform/Settings.cpp b/rEFIt_UEFI/Platform/Settings.cpp index fc1c87532..20f7613ca 100644 --- a/rEFIt_UEFI/Platform/Settings.cpp +++ b/rEFIt_UEFI/Platform/Settings.cpp @@ -335,10 +335,10 @@ ParseLoadOptions ( } for (i = 0; PlistStrings[i][0] != '\0'; i++) { - PlistStringsLen = AsciiStrLen (PlistStrings[i]); + PlistStringsLen = AsciiStrLen(PlistStrings[i]); //DBG("PlistStrings[%d] = %s\n", i, PlistStrings[i]); if (PlistStringsLen < TailSize) { - if (AsciiStriNCmp (PlistStrings[i], Start, PlistStringsLen)) { + if (AsciiStriNCmp(PlistStrings[i], Start, PlistStringsLen)) { DBG(" - found plist string = %s, parse XML in LoadOptions\n", PlistStrings[i]); if (ParseXML (Start, Dict, (UINT32)TailSize) != EFI_SUCCESS) { *Dict = NULL; @@ -358,7 +358,7 @@ ParseLoadOptions ( // DBG("TailSize2 = %d\n", TailSize); if (TailSize > 6) { - if (AsciiStriNCmp (".plist", End - 6, 6)) { + if (AsciiStriNCmp(".plist", End - 6, 6)) { End -= 6; TailSize -= 6; // DBG("TailSize3 = %d\n", TailSize); @@ -370,7 +370,7 @@ ParseLoadOptions ( AsciiConf = (__typeof__(AsciiConf))AllocateCopyPool(TailSize + 1, Start); if (AsciiConf != NULL) { *(AsciiConf + TailSize) = '\0'; - *Conf = (__typeof_am__(*Conf))AllocateZeroPool ((TailSize + 1) * sizeof(**Conf)); + *Conf = (__typeof_am__(*Conf))AllocateZeroPool((TailSize + 1) * sizeof(**Conf)); AsciiStrToUnicodeStrS (AsciiConf, *Conf, TailSize); FreePool(AsciiConf); } @@ -425,7 +425,7 @@ SetBootCurrent(REFIT_MENU_ITEM_BOOTNUM *Entry) VarName = PoolPrint(L"Boot%04x", Entry->BootNum); - BootVariable = (UINT8*)GetNvramVariable (VarName, &gEfiGlobalVariableGuid, NULL, &VarSize); + BootVariable = (UINT8*)GetNvramVariable(VarName, &gEfiGlobalVariableGuid, NULL, &VarSize); if ((BootVariable == NULL) || (VarSize == 0)) { DBG("Boot option %ls not found\n", VarName); FreePool(VarName); @@ -474,7 +474,7 @@ SetBootCurrent(REFIT_MENU_ITEM_BOOTNUM *Entry) DBG("Can't save BootCurrent, status=%s\n", strerror(Status)); } //Next step is rotate BootOrder to set BootNum to first place - BootOrder = (__typeof__(BootOrder))GetNvramVariable (L"BootOrder", &gEfiGlobalVariableGuid, NULL, &BootOrderSize); + BootOrder = (__typeof__(BootOrder))GetNvramVariable(L"BootOrder", &gEfiGlobalVariableGuid, NULL, &BootOrderSize); if (BootOrder == NULL) { return; } @@ -534,7 +534,7 @@ UINT8 if (Prop != NULL) { if (Prop->data != NULL /*&& Prop->dataLen > 0*/) { //rehabman: allow zero length data // data property - Data = (__typeof__(Data))AllocateZeroPool (Prop->dataLen); + Data = (__typeof__(Data))AllocateZeroPool(Prop->dataLen); CopyMem (Data, Prop->data, Prop->dataLen); if (DataLen != NULL) { @@ -549,7 +549,7 @@ UINT8 */ } else { // assume data in hex encoded string property - Len = (UINT32)AsciiStrLen (Prop->string) >> 1; // number of hex digits + Len = (UINT32)AsciiStrLen(Prop->string) >> 1; // number of hex digits Data = (__typeof__(Data))AllocateZeroPool(Len); // 2 chars per byte, one more byte for odd number Len = hex2bin (Prop->string, Data, Len); @@ -856,7 +856,7 @@ CUSTOM_LOADER_ENTRY return NULL; } -// DuplicateEntry = (CUSTOM_LOADER_ENTRY *)AllocateZeroPool (sizeof(CUSTOM_LOADER_ENTRY)); +// DuplicateEntry = (CUSTOM_LOADER_ENTRY *)AllocateZeroPool(sizeof(CUSTOM_LOADER_ENTRY)); CUSTOM_LOADER_ENTRY* DuplicateEntry = new CUSTOM_LOADER_ENTRY; if (DuplicateEntry != NULL) { if (Entry->Volume != NULL) { @@ -1017,7 +1017,7 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches, INTN i, Count = GetTagCount (Prop); if (Count > 0) { TagPtr Prop2 = NULL; - CHAR16 **newForceKexts = (__typeof__(newForceKexts))AllocateZeroPool ((Patches->NrForceKexts + Count) * sizeof(CHAR16 *)); + CHAR16 **newForceKexts = (__typeof__(newForceKexts))AllocateZeroPool((Patches->NrForceKexts + Count) * sizeof(CHAR16 *)); if (Patches->ForceKexts != NULL) { CopyMem (newForceKexts, Patches->ForceKexts, (Patches->NrForceKexts * sizeof(CHAR16 *))); @@ -1044,7 +1044,7 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches, } if (AsciiStrSize(Prop2->string) > 1) { - Patches->ForceKexts[Patches->NrForceKexts] = (__typeof_am__(Patches->ForceKexts[Patches->NrForceKexts]))AllocateZeroPool (AsciiStrSize(Prop2->string) * sizeof(CHAR16)); + Patches->ForceKexts[Patches->NrForceKexts] = (__typeof_am__(Patches->ForceKexts[Patches->NrForceKexts]))AllocateZeroPool(AsciiStrSize(Prop2->string) * sizeof(CHAR16)); AsciiStrToUnicodeStrS(Prop2->string, Patches->ForceKexts[Patches->NrForceKexts], 255); DBG(" - [%d]: %ls\n", Patches->NrForceKexts, Patches->ForceKexts[Patches->NrForceKexts]); ++Patches->NrForceKexts; @@ -1098,7 +1098,7 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches, } if (Count > 0) { TagPtr Prop2 = NULL, Dict = NULL; - KEXT_PATCH *newPatches = (__typeof__(newPatches))AllocateZeroPool (Count * sizeof(KEXT_PATCH)); + KEXT_PATCH *newPatches = (__typeof__(newPatches))AllocateZeroPool(Count * sizeof(KEXT_PATCH)); Patches->KextPatches = newPatches; DBG("KextsToPatch: %lld requested\n", Count); @@ -1159,7 +1159,7 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches, TmpData = GetDataSetting (Prop2, "MaskStart", &ReplaceLen); ReplaceLen = MIN(ReplaceLen, FindLen); if (FindLen != 0) { - Patches->KextPatches[Patches->NrKexts].StartMask = (__typeof__(Patches->KextPatches[Patches->NrKexts].StartMask))AllocateZeroPool (FindLen); + Patches->KextPatches[Patches->NrKexts].StartMask = (__typeof__(Patches->KextPatches[Patches->NrKexts].StartMask))AllocateZeroPool(FindLen); SetMem(Patches->KextPatches[Patches->NrKexts].StartMask, FindLen, 0xFF); if (TmpData != NULL) { CopyMem(Patches->KextPatches[Patches->NrKexts].StartMask, TmpData, ReplaceLen); @@ -1200,7 +1200,7 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches, } FreePool(TmpData); // take into account a possibility to set ReplaceLen < FindLen. In this case assumes MaskReplace = 0 for the rest of bytes - Patches->KextPatches[Patches->NrKexts].Patch = (__typeof__(Patches->KextPatches[Patches->NrKexts].Patch))AllocateZeroPool (FindLen); + Patches->KextPatches[Patches->NrKexts].Patch = (__typeof__(Patches->KextPatches[Patches->NrKexts].Patch))AllocateZeroPool(FindLen); ReplaceLen = MIN(ReplaceLen, FindLen); CopyMem(Patches->KextPatches[Patches->NrKexts].Patch, TmpPatch, ReplaceLen); FreePool(TmpPatch); @@ -1211,7 +1211,7 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches, if (TmpData == NULL || MaskLen == 0) { Patches->KextPatches[Patches->NrKexts].MaskReplace = NULL; } else { - Patches->KextPatches[Patches->NrKexts].MaskReplace = (__typeof__(Patches->KextPatches[Patches->NrKexts].MaskReplace))AllocateZeroPool (FindLen); + Patches->KextPatches[Patches->NrKexts].MaskReplace = (__typeof__(Patches->KextPatches[Patches->NrKexts].MaskReplace))AllocateZeroPool(FindLen); CopyMem(Patches->KextPatches[Patches->NrKexts].MaskReplace, TmpData, MaskLen); //other bytes are zeros, means no replace } FreePool(TmpData); @@ -1294,7 +1294,7 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches, } if (Count > 0) { TagPtr Prop2 = NULL, Dict = NULL; - KERNEL_PATCH *newPatches = (__typeof__(newPatches))AllocateZeroPool (Count * sizeof(KERNEL_PATCH)); + KERNEL_PATCH *newPatches = (__typeof__(newPatches))AllocateZeroPool(Count * sizeof(KERNEL_PATCH)); Patches->KernelPatches = newPatches; DBG("KernelToPatch: %lld requested\n", Count); @@ -1337,7 +1337,7 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches, TmpData = GetDataSetting (Prop2, "MaskStart", &ReplaceLen); ReplaceLen = MIN(ReplaceLen, FindLen); if (FindLen != 0) { - Patches->KernelPatches[Patches->NrKernels].StartMask = (__typeof__(Patches->KernelPatches[Patches->NrKernels].StartMask))AllocateZeroPool (FindLen); + Patches->KernelPatches[Patches->NrKernels].StartMask = (__typeof__(Patches->KernelPatches[Patches->NrKernels].StartMask))AllocateZeroPool(FindLen); SetMem(Patches->KernelPatches[Patches->NrKernels].StartMask, FindLen, 0xFF); if (TmpData != NULL) { CopyMem(Patches->KernelPatches[Patches->NrKernels].StartMask, TmpData, ReplaceLen); @@ -1387,7 +1387,7 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches, if (TmpData == NULL || MaskLen == 0) { Patches->KernelPatches[Patches->NrKernels].MaskReplace = NULL; } else { - Patches->KernelPatches[Patches->NrKernels].MaskReplace = (__typeof__(Patches->KernelPatches[Patches->NrKernels].MaskReplace))AllocateZeroPool (FindLen); + Patches->KernelPatches[Patches->NrKernels].MaskReplace = (__typeof__(Patches->KernelPatches[Patches->NrKernels].MaskReplace))AllocateZeroPool(FindLen); CopyMem(Patches->KernelPatches[Patches->NrKernels].MaskReplace, TmpData, MaskLen); } FreePool(TmpData); @@ -1454,7 +1454,7 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches, } if (Count > 0) { TagPtr Prop2 = NULL, Dict = NULL; - KERNEL_PATCH *newPatches = (__typeof__(newPatches))AllocateZeroPool (Count * sizeof(KERNEL_PATCH)); + KERNEL_PATCH *newPatches = (__typeof__(newPatches))AllocateZeroPool(Count * sizeof(KERNEL_PATCH)); Patches->BootPatches = newPatches; DBG("BootPatches: %lld requested\n", Count); @@ -1498,7 +1498,7 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches, TmpData = GetDataSetting (Prop2, "MaskStart", &ReplaceLen); ReplaceLen = MIN(ReplaceLen, FindLen); if (FindLen != 0) { - Patches->BootPatches[Patches->NrBoots].StartMask = (__typeof__(Patches->BootPatches[Patches->NrBoots].StartMask))AllocateZeroPool (FindLen); + Patches->BootPatches[Patches->NrBoots].StartMask = (__typeof__(Patches->BootPatches[Patches->NrBoots].StartMask))AllocateZeroPool(FindLen); SetMem(Patches->BootPatches[Patches->NrBoots].StartMask, FindLen, 0xFF); if (TmpData != NULL) { CopyMem(Patches->BootPatches[Patches->NrBoots].StartMask, TmpData, ReplaceLen); @@ -1530,7 +1530,7 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches, CopyMem(Patches->BootPatches[Patches->NrBoots].MaskFind, TmpData, MaskLen); } FreePool(TmpData); - Patches->BootPatches[Patches->NrBoots].Patch = (__typeof__(Patches->BootPatches[Patches->NrBoots].Patch))AllocateZeroPool (FindLen); + Patches->BootPatches[Patches->NrBoots].Patch = (__typeof__(Patches->BootPatches[Patches->NrBoots].Patch))AllocateZeroPool(FindLen); CopyMem(Patches->BootPatches[Patches->NrBoots].Patch, TmpPatch, ReplaceLen); FreePool(TmpPatch); MaskLen = 0; @@ -1539,7 +1539,7 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches, if (TmpData == NULL || MaskLen == 0) { Patches->BootPatches[Patches->NrBoots].MaskReplace = NULL; //this is old behavior } else { - Patches->BootPatches[Patches->NrBoots].MaskReplace = (__typeof__(Patches->BootPatches[Patches->NrBoots].MaskReplace))AllocateZeroPool (FindLen); + Patches->BootPatches[Patches->NrBoots].MaskReplace = (__typeof__(Patches->BootPatches[Patches->NrBoots].MaskReplace))AllocateZeroPool(FindLen); CopyMem(Patches->BootPatches[Patches->NrBoots].MaskReplace, TmpData, MaskLen); } FreePool(TmpData); @@ -2512,7 +2512,7 @@ GetEarlyUserSettings ( if (AsciiStriCmp (Prop->string, "LastBootedVolume") == 0) { gSettings.LastBootedVolume = TRUE; } else { - gSettings.DefaultVolume = (__typeof__(gSettings.DefaultVolume))AllocateZeroPool (Size * sizeof(CHAR16)); + gSettings.DefaultVolume = (__typeof__(gSettings.DefaultVolume))AllocateZeroPool(Size * sizeof(CHAR16)); AsciiStrToUnicodeStrS(Prop->string, gSettings.DefaultVolume, Size); } } @@ -2520,7 +2520,7 @@ GetEarlyUserSettings ( Prop = GetProperty(DictPointer, "DefaultLoader"); if (Prop != NULL) { - gSettings.DefaultLoader = (__typeof__(gSettings.DefaultLoader))AllocateZeroPool (AsciiStrSize (Prop->string) * sizeof(CHAR16)); + gSettings.DefaultLoader = (__typeof__(gSettings.DefaultLoader))AllocateZeroPool(AsciiStrSize (Prop->string) * sizeof(CHAR16)); AsciiStrToUnicodeStrS (Prop->string, gSettings.DefaultLoader, AsciiStrSize (Prop->string)); } @@ -2602,7 +2602,7 @@ GetEarlyUserSettings ( INTN i, Count = GetTagCount (Prop); if (Count > 0) { gSettings.SecureBootWhiteListCount = 0; - gSettings.SecureBootWhiteList = (__typeof__(gSettings.SecureBootWhiteList))AllocateZeroPool (Count * sizeof(CHAR16 *)); + gSettings.SecureBootWhiteList = (__typeof__(gSettings.SecureBootWhiteList))AllocateZeroPool(Count * sizeof(CHAR16 *)); if (gSettings.SecureBootWhiteList) { for (i = 0; i < Count; i++) { if (EFI_ERROR(GetElement (Prop, i, &Dict2))) { @@ -2626,7 +2626,7 @@ GetEarlyUserSettings ( INTN i, Count = GetTagCount (Prop); if (Count > 0) { gSettings.SecureBootBlackListCount = 0; - gSettings.SecureBootBlackList = (__typeof__(gSettings.SecureBootBlackList))AllocateZeroPool (Count * sizeof(CHAR16 *)); + gSettings.SecureBootBlackList = (__typeof__(gSettings.SecureBootBlackList))AllocateZeroPool(Count * sizeof(CHAR16 *)); if (gSettings.SecureBootBlackList) { for (i = 0; i < Count; i++) { if (EFI_ERROR(GetElement (Prop, i, &Dict2))) { @@ -2933,7 +2933,7 @@ GetEarlyUserSettings ( INTN i, Count = GetTagCount (Prop); if (Count > 0) { gSettings.HVCount = 0; - gSettings.HVHideStrings = (__typeof__(gSettings.HVHideStrings))AllocateZeroPool (Count * sizeof(CHAR16 *)); + gSettings.HVHideStrings = (__typeof__(gSettings.HVHideStrings))AllocateZeroPool(Count * sizeof(CHAR16 *)); if (gSettings.HVHideStrings) { for (i = 0; i < Count; i++) { if (EFI_ERROR(GetElement (Prop, i, &Dict2))) { @@ -3031,7 +3031,7 @@ GetEarlyUserSettings ( break; } // Allocate an entry -// Entry = (CUSTOM_LOADER_ENTRY *)AllocateZeroPool (sizeof(CUSTOM_LOADER_ENTRY)); +// Entry = (CUSTOM_LOADER_ENTRY *)AllocateZeroPool(sizeof(CUSTOM_LOADER_ENTRY)); CUSTOM_LOADER_ENTRY* Entry = new CUSTOM_LOADER_ENTRY; // Fill it in @@ -3183,7 +3183,7 @@ GetEarlyUserSettings ( INTN i, Count = GetTagCount (DictPointer); if (Count > 0) { gSettings.BlackListCount = 0; - gSettings.BlackList = (__typeof__(gSettings.BlackList))AllocateZeroPool (Count * sizeof(CHAR16 *)); + gSettings.BlackList = (__typeof__(gSettings.BlackList))AllocateZeroPool(Count * sizeof(CHAR16 *)); for (i = 0; i < Count; i++) { if (!EFI_ERROR(GetElement (DictPointer, i, &Prop)) && @@ -3311,7 +3311,7 @@ GetListOfACPI () snwprintf(FullName, 512, "%ls\\%ls", AcpiPath, DirEntry->FileName); if (FileExists(SelfRootDir, FullName)) { BOOLEAN ACPIDisabled = FALSE; - ACPIPatchedAMLTmp = (__typeof__(ACPIPatchedAMLTmp))AllocateZeroPool (sizeof(ACPI_PATCHED_AML)); + ACPIPatchedAMLTmp = (__typeof__(ACPIPatchedAMLTmp))AllocateZeroPool(sizeof(ACPI_PATCHED_AML)); ACPIPatchedAMLTmp->FileName = PoolPrint(L"%s", DirEntry->FileName); for (i = 0; i < Count; i++) { @@ -3394,7 +3394,7 @@ VOID GetListOfInjectKext(CHAR16 *KextDirNameUnderOEMPath) */ FullName = PoolPrint(L"%s\\%s", FullPath, DirEntry->FileName); - mKext = (__typeof__(mKext))AllocateZeroPool (sizeof(SIDELOAD_KEXT)); + mKext = (__typeof__(mKext))AllocateZeroPool(sizeof(SIDELOAD_KEXT)); mKext->FileName = PoolPrint(L"%s", DirEntry->FileName); mKext->MenuItem.BValue = Blocked; mKext->KextDirNameUnderOEMPath = PoolPrint(L"%s", KextDirNameUnderOEMPath); @@ -4210,12 +4210,12 @@ ParseSMBIOSSettings( i = gSettings.RomVersion; j = Prop->string; - i += AsciiStrLen (i); + i += AsciiStrLen(i); while (*i != '.') { i--; } - j += AsciiStrLen (j); + j += AsciiStrLen(j); while (*j != '.') { j--; } @@ -4374,7 +4374,7 @@ ParseSMBIOSSettings( i = gSettings.ReleaseDate; j = gSettings.RomVersion; - j += AsciiStrLen (j); + j += AsciiStrLen(j); while (*j != '.') { j--; } @@ -4401,7 +4401,7 @@ ParseSMBIOSSettings( i = gSettings.ReleaseDate; j = gSettings.RomVersion; - j += AsciiStrLen (j); + j += AsciiStrLen(j); while (*j != '.') { j--; } @@ -4505,7 +4505,7 @@ ParseSMBIOSSettings( } Prop = GetProperty(DictPointer, "BoardSerialNumber"); - if (Prop != NULL && AsciiStrLen (Prop->string) > 0) { + if (Prop != NULL && AsciiStrLen(Prop->string) > 0) { AsciiStrCpyS (gSettings.BoardSerialNumber, 64, Prop->string); } @@ -4987,7 +4987,7 @@ GetUserSettings( if (Count > 0) { DBG("Add %lld properties:\n", Count); - gSettings.AddProperties = (__typeof__(gSettings.AddProperties))AllocateZeroPool (Count * sizeof(DEV_PROPERTY)); + gSettings.AddProperties = (__typeof__(gSettings.AddProperties))AllocateZeroPool(Count * sizeof(DEV_PROPERTY)); for (i = 0; i < Count; i++) { UINTN Size = 0; @@ -5052,7 +5052,7 @@ GetUserSettings( if (Prop2 && (Prop2->type == kTagTypeString) && Prop2->string) { //first suppose it is Ascii string gSettings.AddProperties[Index].Value = (__typeof__(gSettings.AddProperties[Index].Value))AllocateCopyPool(AsciiStrSize (Prop2->string), Prop2->string); - gSettings.AddProperties[Index].ValueLen = AsciiStrLen (Prop2->string) + 1; + gSettings.AddProperties[Index].ValueLen = AsciiStrLen(Prop2->string) + 1; } else if (Prop2 && (Prop2->type == kTagTypeInteger)) { gSettings.AddProperties[Index].Value = (__typeof__(gSettings.AddProperties[Index].Value))AllocatePool (4); CopyMem (gSettings.AddProperties[Index].Value, &(Prop2->string), 4); @@ -5349,13 +5349,13 @@ GetUserSettings( INTN i, Count = GetTagCount (Prop); if (Count > 0) { gSettings.PatchDsdtNum = (UINT32)Count; - gSettings.PatchDsdtFind = (__typeof__(gSettings.PatchDsdtFind))AllocateZeroPool (Count * sizeof(UINT8*)); - gSettings.PatchDsdtReplace = (__typeof__(gSettings.PatchDsdtReplace))AllocateZeroPool (Count * sizeof(UINT8*)); - gSettings.PatchDsdtTgt = (__typeof__(gSettings.PatchDsdtTgt))AllocateZeroPool (Count * sizeof(UINT8*)); - gSettings.LenToFind = (__typeof__(gSettings.LenToFind))AllocateZeroPool (Count * sizeof(UINT32)); - gSettings.LenToReplace = (__typeof__(gSettings.LenToReplace))AllocateZeroPool (Count * sizeof(UINT32)); - gSettings.PatchDsdtLabel = (__typeof__(gSettings.PatchDsdtLabel))AllocateZeroPool (Count * sizeof(UINT8*)); - gSettings.PatchDsdtMenuItem = (__typeof__(gSettings.PatchDsdtMenuItem))AllocateZeroPool (Count * sizeof(INPUT_ITEM)); + gSettings.PatchDsdtFind = (__typeof__(gSettings.PatchDsdtFind))AllocateZeroPool(Count * sizeof(UINT8*)); + gSettings.PatchDsdtReplace = (__typeof__(gSettings.PatchDsdtReplace))AllocateZeroPool(Count * sizeof(UINT8*)); + gSettings.PatchDsdtTgt = (__typeof__(gSettings.PatchDsdtTgt))AllocateZeroPool(Count * sizeof(UINT8*)); + gSettings.LenToFind = (__typeof__(gSettings.LenToFind))AllocateZeroPool(Count * sizeof(UINT32)); + gSettings.LenToReplace = (__typeof__(gSettings.LenToReplace))AllocateZeroPool(Count * sizeof(UINT32)); + gSettings.PatchDsdtLabel = (__typeof__(gSettings.PatchDsdtLabel))AllocateZeroPool(Count * sizeof(UINT8*)); + gSettings.PatchDsdtMenuItem = (__typeof__(gSettings.PatchDsdtMenuItem))AllocateZeroPool(Count * sizeof(INPUT_ITEM)); DBG("PatchesDSDT: %lld requested\n", Count); for (i = 0; i < Count; i++) { @@ -5659,7 +5659,7 @@ GetUserSettings( Prop2 = NULL; if (Count > 0) { gSettings.SortedACPICount = 0; - gSettings.SortedACPI = (__typeof__(gSettings.SortedACPI))AllocateZeroPool (Count * sizeof(CHAR16 *)); + gSettings.SortedACPI = (__typeof__(gSettings.SortedACPI))AllocateZeroPool(Count * sizeof(CHAR16 *)); for (i = 0; i < Count; i++) { if (!EFI_ERROR(GetElement (Prop, i, &Prop2)) && @@ -5679,7 +5679,7 @@ GetUserSettings( Prop2 = NULL; if (Count > 0) { gSettings.DisabledAMLCount = 0; - gSettings.DisabledAML = (__typeof__(gSettings.DisabledAML))AllocateZeroPool (Count * sizeof(CHAR16 *)); + gSettings.DisabledAML = (__typeof__(gSettings.DisabledAML))AllocateZeroPool(Count * sizeof(CHAR16 *)); if (gSettings.DisabledAML) { for (i = 0; i < Count; i++) { @@ -6052,7 +6052,7 @@ GetUserSettings( // MLB: some value Prop = GetProperty(DictPointer, "MLB"); - if (Prop != NULL && AsciiStrLen (Prop->string) > 0) { + if (Prop != NULL && AsciiStrLen(Prop->string) > 0) { gSettings.RtMLB = (__typeof__(gSettings.RtMLB))AllocateCopyPool(AsciiStrSize (Prop->string), Prop->string); } // CsrActiveConfig @@ -6064,7 +6064,7 @@ GetUserSettings( gSettings.BooterConfig = (UINT16)GetPropertyInteger(Prop, 0); //the value 0 means not set //let it be string like "log=0" Prop = GetProperty(DictPointer, "BooterCfg"); - if (Prop != NULL && AsciiStrLen (Prop->string) > 0) { + if (Prop != NULL && AsciiStrLen(Prop->string) > 0) { AsciiStrCpyS (gSettings.BooterCfgStr, 64, Prop->string); } //Block external variables @@ -7909,7 +7909,7 @@ SetDevices (LOADER_ENTRY *Entry) // DBG("\n"); // StringDirty = FALSE; //------- - mPropSize = (UINT32)AsciiStrLen (gDeviceProperties) / 2; + mPropSize = (UINT32)AsciiStrLen(gDeviceProperties) / 2; // DBG("Preliminary size of mProperties=%d\n", mPropSize); mPropSize = hex2bin (gDeviceProperties, mProperties, mPropSize); // DBG("Final size of mProperties=%d\n", mPropSize); diff --git a/rEFIt_UEFI/Platform/kernel_patcher.cpp b/rEFIt_UEFI/Platform/kernel_patcher.cpp index 9837e43eb..111854730 100644 --- a/rEFIt_UEFI/Platform/kernel_patcher.cpp +++ b/rEFIt_UEFI/Platform/kernel_patcher.cpp @@ -116,6 +116,9 @@ UINTN searchProc(unsigned char * kernel, UINTN kernelSize, const char *procedure return 0; } UINT64 procAddr = vArray[i].ProcAddr - Absolut; + if (vArray[i].Attr == 0x1a0f) { + procAddr += 0x9e000; + } UINT64 prevAddr; if (i == 0) { prevAddr = Absolut; diff --git a/rEFIt_UEFI/Platform/platformdata.cpp b/rEFIt_UEFI/Platform/platformdata.cpp index b99b6ea80..442261c08 100644 --- a/rEFIt_UEFI/Platform/platformdata.cpp +++ b/rEFIt_UEFI/Platform/platformdata.cpp @@ -612,7 +612,7 @@ VOID SetDMISettingsForModel(MACHINE_TYPES Model, BOOLEAN Redefine) case Xserve21: case Xserve31: i = ApplePlatformData[Model].firmwareVersion; - i += AsciiStrLen (i); + i += AsciiStrLen(i); while (*i != '.') { i--; @@ -623,7 +623,7 @@ VOID SetDMISettingsForModel(MACHINE_TYPES Model, BOOLEAN Redefine) default: i = ApplePlatformData[Model].firmwareVersion; - i += AsciiStrLen (i); + i += AsciiStrLen(i); while (*i != '.') { i--; @@ -1369,7 +1369,7 @@ VOID GetDefaultSettings() gSettings.BooterConfig = 0; // MemSet(gSettings.BooterCfgStr, 64, 0); // AsciiStrCpyS(gSettings.BooterCfgStr, 64, "log=0"); - CHAR8 *OldCfgStr = (__typeof__(OldCfgStr))GetNvramVariable (L"bootercfg", &gEfiAppleBootGuid, NULL, NULL); + CHAR8 *OldCfgStr = (__typeof__(OldCfgStr))GetNvramVariable(L"bootercfg", &gEfiAppleBootGuid, NULL, NULL); if (OldCfgStr) { AsciiStrCpyS(gSettings.BooterCfgStr, 64, OldCfgStr); FreePool(OldCfgStr); diff --git a/rEFIt_UEFI/libeg/BmLib.cpp b/rEFIt_UEFI/libeg/BmLib.cpp index 9b69fd74b..817358828 100644 --- a/rEFIt_UEFI/libeg/BmLib.cpp +++ b/rEFIt_UEFI/libeg/BmLib.cpp @@ -114,7 +114,7 @@ EfiLibFileSystemVolumeLabelInfo ( if (Status == EFI_BUFFER_TOO_SMALL) { // inc size by 2 because some drivers (HFSPlus.efi) do not count 0 at the end of file name Size += 2; - VolumeInfo = (__typeof__(VolumeInfo))AllocateZeroPool (Size); + VolumeInfo = (__typeof__(VolumeInfo))AllocateZeroPool(Size); Status = FHand->GetInfo (FHand, &gEfiFileSystemVolumeLabelInfoIdGuid, &Size, VolumeInfo); // Check to make sure this isn't actually EFI_FILE_SYSTEM_INFO if (!EFI_ERROR(Status)) @@ -183,7 +183,7 @@ StriCmp ( // If Null-terminated strings are case insensitive equal or its sSize symbols are equal then TRUE BOOLEAN -AsciiStriNCmp ( +AsciiStriNCmp( IN CONST CHAR8 *FirstS, IN CONST CHAR8 *SecondS, IN CONST UINTN sSize @@ -242,7 +242,7 @@ EfiLibFileInfo ( if (Status == EFI_BUFFER_TOO_SMALL) { // inc size by 2 because some drivers (HFSPlus.efi) do not count 0 at the end of file name Size += 2; - FileInfo = (__typeof__(FileInfo))AllocateZeroPool (Size); + FileInfo = (__typeof__(FileInfo))AllocateZeroPool(Size); Status = FHand->GetInfo (FHand, &gEfiFileInfoGuid, &Size, FileInfo); } @@ -262,7 +262,7 @@ EfiLibFileSystemInfo ( if (Status == EFI_BUFFER_TOO_SMALL) { // inc size by 2 because some drivers (HFSPlus.efi) do not count 0 at the end of file name Size += 2; - FileSystemInfo = (__typeof__(FileSystemInfo))AllocateZeroPool (Size); + FileSystemInfo = (__typeof__(FileSystemInfo))AllocateZeroPool(Size); Status = FHand->GetInfo (FHand, &gEfiFileSystemInfoGuid, &Size, FileSystemInfo); } @@ -319,7 +319,7 @@ EfiReallocatePool ( NewPool = NULL; if (NewSize != 0) { - NewPool = (__typeof__(NewPool))AllocateZeroPool (NewSize); + NewPool = (__typeof__(NewPool))AllocateZeroPool(NewSize); } if (OldPool != NULL) { diff --git a/rEFIt_UEFI/libeg/BmLib.h b/rEFIt_UEFI/libeg/BmLib.h index b059d4c73..674e3ed49 100644 --- a/rEFIt_UEFI/libeg/BmLib.h +++ b/rEFIt_UEFI/libeg/BmLib.h @@ -87,7 +87,7 @@ StriCmp ( // If Null-terminated strings are case insensitive equal or its sSize symbols are equal then TRUE BOOLEAN -AsciiStriNCmp ( +AsciiStriNCmp( IN CONST CHAR8 *FirstS, IN CONST CHAR8 *SecondS, IN CONST UINTN sSize diff --git a/rEFIt_UEFI/refit/IO.cpp b/rEFIt_UEFI/refit/IO.cpp index a0947349e..032f19b6a 100644 --- a/rEFIt_UEFI/refit/IO.cpp +++ b/rEFIt_UEFI/refit/IO.cpp @@ -721,12 +721,12 @@ Returns: return 0; } - Item.Scratch = (__typeof__(Item.Scratch))AllocateZeroPool (sizeof (CHAR16) * PRINT_ITEM_BUFFER_LEN); + Item.Scratch = (__typeof__(Item.Scratch))AllocateZeroPool(sizeof (CHAR16) * PRINT_ITEM_BUFFER_LEN); if (NULL == Item.Scratch) { return EFI_OUT_OF_RESOURCES; } - Buffer = (__typeof__(Buffer))AllocateZeroPool (sizeof (CHAR16) * PRINT_STRING_LEN); + Buffer = (__typeof__(Buffer))AllocateZeroPool(sizeof (CHAR16) * PRINT_STRING_LEN); if (NULL == Buffer) { FreePool(Item.Scratch); return EFI_OUT_OF_RESOURCES; diff --git a/rEFIt_UEFI/refit/lib.cpp b/rEFIt_UEFI/refit/lib.cpp index c35cca7a8..ff267228a 100644 --- a/rEFIt_UEFI/refit/lib.cpp +++ b/rEFIt_UEFI/refit/lib.cpp @@ -1414,7 +1414,7 @@ EFI_STATUS DirNextEntry(IN EFI_FILE *Directory, IN OUT EFI_FILE_INFO **DirEntry, // read next directory entry LastBufferSize = BufferSize = 256; - Buffer = (__typeof__(Buffer))AllocateZeroPool (BufferSize); + Buffer = (__typeof__(Buffer))AllocateZeroPool(BufferSize); for (IterCount = 0; ; IterCount++) { Status = Directory->Read(Directory, &BufferSize, Buffer); if (Status != EFI_BUFFER_TOO_SMALL || IterCount >= 4) diff --git a/rEFIt_UEFI/refit/list.cpp b/rEFIt_UEFI/refit/list.cpp index 437d6da0a..10a607206 100644 --- a/rEFIt_UEFI/refit/list.cpp +++ b/rEFIt_UEFI/refit/list.cpp @@ -146,7 +146,7 @@ // // // // Create a new list entry // // -// CurrentList = (__typeof__(CurrentList))AllocateZeroPool (sizeof (REFIT_LIST)); +// CurrentList = (__typeof__(CurrentList))AllocateZeroPool(sizeof (REFIT_LIST)); // // if (!CurrentList) { // return EFI_OUT_OF_RESOURCES; From d79d247a61bf6cfe6ffe342d744f016d2993ef55 Mon Sep 17 00:00:00 2001 From: vectorsigma72 Date: Tue, 28 Apr 2020 15:08:11 +0200 Subject: [PATCH 3/4] Clover.app: clean up after update. Fixed a possible error caused by temporary files left. --- CloverApp/Clover/SettingsView.swift | 13 +++++++++++++ .../CloverDaemonNew/BootInstaller.swift | 2 +- .../CloverDaemonNew/CloverDaemonNew/main.swift | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/CloverApp/Clover/SettingsView.swift b/CloverApp/Clover/SettingsView.swift index a4bc15f67..0b23b9062 100644 --- a/CloverApp/Clover/SettingsView.swift +++ b/CloverApp/Clover/SettingsView.swift @@ -1334,6 +1334,13 @@ final class SettingsViewController: self.downloadTask?.resume() } + func cleanUpdateDirectory() { + let tempDir = "/tmp/CloverXXXXX\(NSUserName())Update" + if fm.fileExists(atPath: tempDir) { + try? fm.removeItem(atPath: tempDir) + } + } + func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didFinishDownloadingTo location: URL) { @@ -1385,6 +1392,8 @@ final class SettingsViewController: task.terminationHandler = { t in if t.terminationStatus == 0 { self.replaceCloverV2(with: tempDir.addPath("CloverV2")) + } else { + self.cleanUpdateDirectory() } } @@ -1408,6 +1417,7 @@ final class SettingsViewController: } if (error != nil) { print(error!.localizedDescription) + self.cleanUpdateDirectory() } } @@ -1459,6 +1469,8 @@ final class SettingsViewController: try fm.removeItem(atPath: Cloverv2Path) } try fm.copyItem(atPath: newOne, toPath: Cloverv2Path) + self.cleanUpdateDirectory() + DispatchQueue.main.async { self.lastReleaseRev = nil self.lastReleaseLink = nil @@ -1486,6 +1498,7 @@ final class SettingsViewController: } try fm.createDirectory(atPath: new, withIntermediateDirectories: false, attributes: nil) try fm.copyItem(atPath: path, toPath: new.addPath(path.lastPath)) + self.cleanUpdateDirectory() DispatchQueue.main.async { self.lastReleaseRev = nil self.lastReleaseLink = nil diff --git a/CloverApp/CloverDaemonNew/CloverDaemonNew/BootInstaller.swift b/CloverApp/CloverDaemonNew/CloverDaemonNew/BootInstaller.swift index 8b27f83d6..3b9837fc8 100644 --- a/CloverApp/CloverDaemonNew/CloverDaemonNew/BootInstaller.swift +++ b/CloverApp/CloverDaemonNew/CloverDaemonNew/BootInstaller.swift @@ -31,7 +31,7 @@ final class Installer: NSObject { } else { t.launchPath = "/bin/bash" } - t.arguments = ["-c", "rm -f /tmp/Clover* && rm -f /tmp/boot0* && rm -f /tmp/boot1*"] + t.arguments = ["-c", "rm -rf /tmp/Clover* && rm -f /tmp/boot0* && rm -f /tmp/boot1*"] t.launch() } diff --git a/CloverApp/CloverDaemonNew/CloverDaemonNew/main.swift b/CloverApp/CloverDaemonNew/CloverDaemonNew/main.swift index dd8b6c7fc..1d011062a 100644 --- a/CloverApp/CloverDaemonNew/CloverDaemonNew/main.swift +++ b/CloverApp/CloverDaemonNew/CloverDaemonNew/main.swift @@ -8,7 +8,7 @@ import Foundation -let daemonVersion = "1.1.2" +let daemonVersion = "1.1.3" let fm = FileManager.default From c91b868595ad5bbe8fcdfd827bceda2d648545fe Mon Sep 17 00:00:00 2001 From: vectorsigma72 Date: Tue, 28 Apr 2020 16:02:26 +0200 Subject: [PATCH 4/4] Warn about Virtual machine Clover.app cannot install from Virtual Machines to real devices. I'm still not sure this is even possible so for now warn the user. --- CloverApp/CloverDaemonNew/CloverDaemonNew/BootInstaller.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CloverApp/CloverDaemonNew/CloverDaemonNew/BootInstaller.swift b/CloverApp/CloverDaemonNew/CloverDaemonNew/BootInstaller.swift index 3b9837fc8..b1505d6d9 100644 --- a/CloverApp/CloverDaemonNew/CloverDaemonNew/BootInstaller.swift +++ b/CloverApp/CloverDaemonNew/CloverDaemonNew/BootInstaller.swift @@ -286,7 +286,7 @@ final class Installer: NSObject { self.log("sleeping 6 seconds..") sleep(6) if !fm.isWritableFile(atPath: targetVol) { - exit("Error: target volume \"\(targetVol)\" is not writable.") + exit("Error: target volume \"\(targetVol)\" is not writable (may be running from a Virtual Machine??).") } else { self.log("'\(targetVol)' is now read/write.") }