]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c
Fix comparisons of enumerated types which may cause warnings for some compilers.
[mirror_edk2.git] / MdeModulePkg / Bus / Pci / PciBusDxe / PciIo.c
index 08ecaa4d1024a63f2ce17efe19df186cafa7ac47..12f6997ac586cf86aecae7efb15fba6fe52fb567 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   EFI PCI IO protocol functions implementation for PCI Bus module.\r
 \r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -85,7 +85,7 @@ PciIoVerifyBarAccess (
   IN UINT64                          *Offset\r
   )\r
 {\r
-  if (Width < 0 || Width >= EfiPciIoWidthMaximum) {\r
+  if ((UINT32)Width >= EfiPciIoWidthMaximum) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
@@ -146,7 +146,7 @@ PciIoVerifyConfigAccess (
 {\r
   UINT64  ExtendOffset;\r
 \r
-  if (Width < 0 || Width >= EfiPciIoWidthMaximum) {\r
+  if ((UINT32)Width >= EfiPciIoWidthMaximum) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
@@ -215,7 +215,7 @@ PciIoPollMem (
 \r
   PciIoDevice = PCI_IO_DEVICE_FROM_PCI_IO_THIS (This);\r
 \r
-  if (Width < 0 || Width >= EfiPciIoWidthMaximum) {\r
+  if ((UINT32)Width >= EfiPciIoWidthMaximum) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
@@ -322,7 +322,7 @@ PciIoPollIo (
 \r
   PciIoDevice = PCI_IO_DEVICE_FROM_PCI_IO_THIS (This);\r
 \r
-  if (Width < 0 || Width > EfiPciIoWidthUint64) {\r
+  if ((UINT32)Width > EfiPciIoWidthUint64) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
@@ -421,7 +421,7 @@ PciIoMemRead (
 \r
   PciIoDevice = PCI_IO_DEVICE_FROM_PCI_IO_THIS (This);\r
 \r
-  if (Width < 0 || Width >= EfiPciIoWidthMaximum) {\r
+  if ((UINT32)Width >= EfiPciIoWidthMaximum) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
@@ -500,7 +500,7 @@ PciIoMemWrite (
 \r
   PciIoDevice = PCI_IO_DEVICE_FROM_PCI_IO_THIS (This);\r
 \r
-  if (Width < 0 || Width >= EfiPciIoWidthMaximum) {\r
+  if ((UINT32)Width >= EfiPciIoWidthMaximum) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
@@ -578,7 +578,7 @@ PciIoIoRead (
 \r
   PciIoDevice = PCI_IO_DEVICE_FROM_PCI_IO_THIS (This);\r
 \r
-  if (Width < 0 || Width >= EfiPciIoWidthMaximum) {\r
+  if ((UINT32)Width >= EfiPciIoWidthMaximum) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
@@ -656,7 +656,7 @@ PciIoIoWrite (
 \r
   PciIoDevice = PCI_IO_DEVICE_FROM_PCI_IO_THIS (This);\r
 \r
-  if (Width < 0 || Width >= EfiPciIoWidthMaximum) {\r
+  if ((UINT32)Width >= EfiPciIoWidthMaximum) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
@@ -881,7 +881,7 @@ PciIoCopyMem (
 \r
   PciIoDevice = PCI_IO_DEVICE_FROM_PCI_IO_THIS (This);\r
 \r
-  if (Width < 0 || Width >= EfiPciIoWidthMaximum) {\r
+  if ((UINT32)Width >= EfiPciIoWidthMaximum) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
@@ -970,7 +970,7 @@ PciIoMap (
 \r
   PciIoDevice = PCI_IO_DEVICE_FROM_PCI_IO_THIS (This);\r
 \r
-  if (Operation < 0 || Operation >= EfiPciIoOperationMaximum) {\r
+  if ((UINT32)Operation >= EfiPciIoOperationMaximum) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r