]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.c
Refine soma code to make code run safely.
[mirror_edk2.git] / MdeModulePkg / Bus / Pci / PciBusDxe / PciEnumerator.c
index fca00840164cc11b140968d5843623b3aed8d440..09b58ac0ded6608db1e484defe2300cc509a7667 100644 (file)
@@ -983,7 +983,7 @@ PciHostBridgeAdjustAllocation (
       // Have no way to get ReqRes, AllocRes & Bar here\r
       //\r
       ZeroMem (&AllocFailExtendedData, sizeof (AllocFailExtendedData));\r
-      AllocFailExtendedData.DevicePathSize = sizeof (EFI_DEVICE_PATH_PROTOCOL);\r
+      AllocFailExtendedData.DevicePathSize = (UINT16) sizeof (EFI_DEVICE_PATH_PROTOCOL);\r
       AllocFailExtendedData.DevicePath     = (UINT8 *) PciResNode->PciDev->DevicePath;\r
       AllocFailExtendedData.Bar            = PciResNode->Bar;\r
 \r
@@ -1108,7 +1108,7 @@ ConstructAcpiResourceRequestor (
     //\r
     if ((Aperture & 0x01) != 0) {\r
       Ptr->Desc     = ACPI_ADDRESS_SPACE_DESCRIPTOR;\r
-      Ptr->Len      = sizeof (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR) - 3;\r
+      Ptr->Len      = (UINT16) (sizeof (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR) - 3);\r
       //\r
       // Io\r
       //\r