]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Bus/Pci/PciBus/Dxe/PciIo.c
Partially make EdkModulePkg pass intel IPF compiler with /W4 /WX switched on.
[mirror_edk2.git] / EdkModulePkg / Bus / Pci / PciBus / Dxe / PciIo.c
index 040c57095d866b244481e6c129ee480e4524c5db..a636d4ff2c1e7bc17b9bd4cb8921840dbddf25e0 100644 (file)
@@ -184,7 +184,7 @@ Returns:
     Count = 1;\r
   }\r
 \r
-  Width &= 0x03;\r
+  Width = (EFI_PCI_IO_PROTOCOL_WIDTH) (Width & 0x03);\r
 \r
   if ((*Offset + Count * (UINTN)(1 << Width)) - 1 >= PciIoDevice->PciBar[BarIndex].Length) {\r
     return EFI_INVALID_PARAMETER;\r
@@ -233,7 +233,7 @@ Returns:
   //\r
   // If Width is EfiPciIoWidthFillUintX then convert to EfiPciIoWidthUintX\r
   //\r
-  Width &= 0x03;\r
+  Width = (EFI_PCI_IO_PROTOCOL_WIDTH) (Width & 0x03);\r
 \r
   if (PciIoDevice->IsPciExp) {\r
     if ((*Offset + Count * (UINTN)(1 << Width)) - 1 >= PCI_EXP_MAX_CONFIG_OFFSET) {\r
@@ -876,7 +876,7 @@ Returns:
   }\r
 \r
   if (PciIoDevice->Attributes & EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE) {\r
-    Operation = Operation + EfiPciOperationBusMasterRead64;\r
+    Operation = (EFI_PCI_IO_PROTOCOL_OPERATION) (Operation + EfiPciOperationBusMasterRead64);\r
   }\r
 \r
   Status = PciIoDevice->PciRootBridgeIo->Map (\r
@@ -1966,10 +1966,15 @@ Returns:
 // TODO:    PciDevice1 - add argument and description to function comment\r
 // TODO:    PciDevice2 - add argument and description to function comment\r
 {\r
+  BOOLEAN   Existed1;\r
+  BOOLEAN   Existed2;\r
 \r
   if (PciDevice1->Parent == PciDevice2->Parent) {\r
     return TRUE;\r
   }\r
 \r
-  return (PciDeviceExisted (PciDevice1->Parent, PciDevice2)|| PciDeviceExisted (PciDevice2->Parent, PciDevice1));\r
+  Existed1 = PciDeviceExisted (PciDevice1->Parent, PciDevice2);\r
+  Existed2 = PciDeviceExisted (PciDevice2->Parent, PciDevice1);\r
+\r
+  return (BOOLEAN) (Existed1 || Existed2);\r
 }\r