From c9325700d0ef25eaf45077928af3f93b15ac5fe0 Mon Sep 17 00:00:00 2001 From: ydong10 Date: Wed, 15 Sep 2010 07:48:11 +0000 Subject: Refine soma code to make code run safely. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10877 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.c | 4 ++-- MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'MdeModulePkg/Bus/Pci/PciBusDxe') diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.c index fca0084016..09b58ac0de 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.c @@ -983,7 +983,7 @@ PciHostBridgeAdjustAllocation ( // Have no way to get ReqRes, AllocRes & Bar here // ZeroMem (&AllocFailExtendedData, sizeof (AllocFailExtendedData)); - AllocFailExtendedData.DevicePathSize = sizeof (EFI_DEVICE_PATH_PROTOCOL); + AllocFailExtendedData.DevicePathSize = (UINT16) sizeof (EFI_DEVICE_PATH_PROTOCOL); AllocFailExtendedData.DevicePath = (UINT8 *) PciResNode->PciDev->DevicePath; AllocFailExtendedData.Bar = PciResNode->Bar; @@ -1108,7 +1108,7 @@ ConstructAcpiResourceRequestor ( // if ((Aperture & 0x01) != 0) { Ptr->Desc = ACPI_ADDRESS_SPACE_DESCRIPTOR; - Ptr->Len = sizeof (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR) - 3; + Ptr->Len = (UINT16) (sizeof (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR) - 3); // // Io // diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c index fe67dc20cd..0969407831 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c @@ -1637,7 +1637,7 @@ PciIoGetBarAttributes ( if (NumConfig == 1) { Ptr->Desc = ACPI_ADDRESS_SPACE_DESCRIPTOR; - Ptr->Len = sizeof (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR) - 3; + Ptr->Len = (UINT16) (sizeof (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR) - 3); Ptr->AddrRangeMin = PciIoDevice->PciBar[BarIndex].BaseAddress; Ptr->AddrLen = PciIoDevice->PciBar[BarIndex].Length; -- cgit v1.2.3