]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Fix comparisons of enumerated types which may cause warnings for some compilers.
authorrsun3 <rsun3@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 28 Aug 2012 06:48:28 +0000 (06:48 +0000)
committerrsun3 <rsun3@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 28 Aug 2012 06:48:28 +0000 (06:48 +0000)
Signed-off-by: Sun Rui <rui.sun@intel.com>
Reviewed-by: Gao Liming <liming.gao@intel.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13686 6f19259b-4bc3-4df7-8a09-765794883524

24 files changed:
DuetPkg/PciBusNoEnumerationDxe/PciIo.c
DuetPkg/PciRootBridgeNoEnumerationDxe/DeviceIo.c
DuetPkg/PciRootBridgeNoEnumerationDxe/Ia32/PcatIo.c
DuetPkg/PciRootBridgeNoEnumerationDxe/Ipf/PcatIo.c
DuetPkg/PciRootBridgeNoEnumerationDxe/PcatPciRootBridgeIo.c
DuetPkg/PciRootBridgeNoEnumerationDxe/X64/PcatIo.c
EdkCompatibilityPkg/Compatibility/DeviceIoOnPciRootBridgeIoThunk/DeviceIoOnPciRootBridgeIoThunk.c
EmulatorPkg/EmuGopDxe/GopScreen.c
IntelFrameworkModulePkg/Bus/Isa/IsaBusDxe/IsaIo.c
IntelFrameworkModulePkg/Bus/Isa/IsaIoDxe/IsaIo.c
IntelFrameworkModulePkg/Universal/CpuIoDxe/CpuIo.c
MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c
MdeModulePkg/Core/Dxe/Event/Timer.c
MdeModulePkg/Core/Dxe/Gcd/Gcd.c
MdeModulePkg/Core/Dxe/Mem/Page.c
MdeModulePkg/Core/Dxe/Mem/Pool.c
OptionRomPkg/CirrusLogic5430Dxe/CirrusLogic5430GraphicsOutput.c
OptionRomPkg/CirrusLogic5430Dxe/CirrusLogic5430UgaDraw.c
PcAtChipsetPkg/8259InterruptControllerDxe/8259.c
PcAtChipsetPkg/PciHostBridgeDxe/PciHostBridge.c
PcAtChipsetPkg/PciHostBridgeDxe/PciRootBridgeIo.c
UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.c
UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.c
UefiCpuPkg/CpuIoPei/CpuIoPei.c

index 61b0870b1afdad960b734c477ede30a3fcd7720e..ffaaaf342beece2e5728333c2e13b20b0e6a6501 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2005 - 2009, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2005 - 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
@@ -343,7 +343,7 @@ Returns:
 \r
 --*/\r
 {\r
-  if (Width < 0 || Width >= EfiPciIoWidthMaximum) {\r
+  if ((UINT32)Width >= EfiPciIoWidthMaximum) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
@@ -404,7 +404,7 @@ Returns:
 {\r
   UINT64  ExtendOffset;\r
 \r
-  if (Width < 0 || Width >= EfiPciIoWidthMaximum) {\r
+  if ((UINT32)Width >= EfiPciIoWidthMaximum) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
@@ -465,7 +465,7 @@ Returns:
 \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
@@ -521,7 +521,7 @@ Returns:
 \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
@@ -576,7 +576,7 @@ Returns:
 \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
@@ -629,7 +629,7 @@ Returns:
   \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
@@ -682,7 +682,7 @@ Returns:
 \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
@@ -735,7 +735,7 @@ Returns:
 \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
@@ -877,7 +877,7 @@ Returns:
 \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
@@ -942,7 +942,7 @@ Returns:
 \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
index 20098d94eb02f1725cc339dfe4932aab0090399e..b9cae2b2ce6ce3fed9e68043b3e5c83e47286221 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2006 - 2008, 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
@@ -363,7 +363,7 @@ Returns:
 \r
   Private = DEVICE_IO_PRIVATE_DATA_FROM_THIS (This);\r
 \r
-  if (Width < 0 || Width >= MMIO_COPY_UINT8) {\r
+  if ((UINT32)Width >= MMIO_COPY_UINT8) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
@@ -415,7 +415,7 @@ Returns:
 \r
   Private = DEVICE_IO_PRIVATE_DATA_FROM_THIS (This);\r
 \r
-  if (Width < 0 || Width >= MMIO_COPY_UINT8) {\r
+  if ((UINT32)Width >= MMIO_COPY_UINT8) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
@@ -648,7 +648,7 @@ Returns:
 \r
   Private = DEVICE_IO_PRIVATE_DATA_FROM_THIS (This);\r
 \r
-  if (Operation < 0 || Operation > EfiBusMasterCommonBuffer) {\r
+  if ((UINT32)Operation > EfiBusMasterCommonBuffer) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
@@ -748,7 +748,7 @@ Returns:
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
-  if ((Type >= MaxAllocateType) || (Type < AllocateAnyPages)) {\r
+  if ((UINT32)Type >= MaxAllocateType) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
index fbfc2fadef5c3e586a94353c205c959b6e6cfc38..d479e7f9fcce85c5f5b49a75a3cb17fa687fa89e 100644 (file)
@@ -102,7 +102,7 @@ PcatRootBridgeIoPciRW (
   UINT64                            PciExpressRegAddr;\r
   BOOLEAN                           UsePciExpressAccess;\r
 \r
-  if (Width < 0 || Width >= EfiPciWidthMaximum) {\r
+  if ((UINT32)Width >= EfiPciWidthMaximum) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
   \r
index 3ba870e6f98c911f39dc584b2440772009bedafa..97857c298186e7ef1a41895647d9e815afd7cd3a 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2005 - 2009, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2005 - 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
@@ -81,7 +81,7 @@ PcatRootBridgeIoIoRead (
     return EFI_INVALID_PARAMETER;\r
   }\r
     \r
-  if (Width < 0 || Width >= EfiPciWidthMaximum) {\r
+  if ((UINT32)Width >= EfiPciWidthMaximum) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
index bfa3363490c1bd4660d008f389f5be591915ed1e..d5d79aee2e9f9b551bf0aeab366069efb3c8bf0e 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2005 - 2009, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2005 - 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
@@ -256,7 +256,7 @@ PcatRootBridgeIoPollMem (
   }\r
 \r
 \r
-  if (Width < 0 || Width > EfiPciWidthUint64) {\r
+  if ((UINT32)Width > EfiPciWidthUint64) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
   //\r
@@ -319,7 +319,7 @@ PcatRootBridgeIoPollIo (
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
-  if (Width < 0 || Width > EfiPciWidthUint64) {\r
+  if ((UINT32)Width > EfiPciWidthUint64) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
   //\r
@@ -412,7 +412,7 @@ PcatRootBridgeIoMemRead (
 \r
   In.buf  = Buffer;\r
   Out.buf = (VOID *)(UINTN) Address;\r
-  if (Width >= EfiPciWidthUint8 && Width <= EfiPciWidthUint64) {\r
+  if ((UINT32)Width <= EfiPciWidthUint64) {\r
     return PcatRootBridgeIoMemRW (Width, Count, TRUE, In, TRUE, Out);\r
   }\r
   if (Width >= EfiPciWidthFifoUint8 && Width <= EfiPciWidthFifoUint64) {\r
@@ -459,7 +459,7 @@ PcatRootBridgeIoMemWrite (
 \r
   In.buf  = (VOID *)(UINTN) Address;\r
   Out.buf = Buffer;\r
-  if (Width >= EfiPciWidthUint8 && Width <= EfiPciWidthUint64) {\r
+  if ((UINT32)Width <= EfiPciWidthUint64) {\r
     return PcatRootBridgeIoMemRW (Width, Count, TRUE, In, TRUE, Out);\r
   }\r
   if (Width >= EfiPciWidthFifoUint8 && Width <= EfiPciWidthFifoUint64) {\r
@@ -489,7 +489,7 @@ PcatRootBridgeIoCopyMem (
   UINTN       Index;\r
   UINT64      Result;\r
 \r
-  if (Width < 0 || Width > EfiPciWidthUint64) {\r
+  if ((UINT32)Width > EfiPciWidthUint64) {\r
     return EFI_INVALID_PARAMETER;\r
   }       \r
 \r
@@ -609,7 +609,7 @@ PcatRootBridgeIoMap (
   //\r
   // Make sure that Operation is valid\r
   //\r
-  if (Operation < 0 || Operation >= EfiPciOperationMaximum) {\r
+  if ((UINT32)Operation >= EfiPciOperationMaximum) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
index 1e4c218032b6393680c3e37df9853bee07269d1e..179df3d5a76453a4feefd820f871784ac5864e50 100644 (file)
@@ -102,7 +102,7 @@ PcatRootBridgeIoPciRW (
   UINT64                            PciExpressRegAddr;\r
   BOOLEAN                           UsePciExpressAccess;\r
 \r
-  if (Width < 0 || Width >= EfiPciWidthMaximum) {\r
+  if ((UINT32)Width >= EfiPciWidthMaximum) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
   \r
index 5171a66b0a8fffde4f1246c9212f7e944e69a45a..da55e12178938b8a8addb4be5fc7be98ede4778d 100644 (file)
@@ -12,7 +12,7 @@ This module module layers Device I/O on top of PCI Root Bridge I/O (Segment 0)
    Platform required to support EFI drivers that consume Device I/O\r
    Platform required to support EFI applications that consume Device I/O\r
 \r
-Copyright (c) 2008 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2008 - 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
@@ -758,7 +758,7 @@ DeviceIoPciRead (
 \r
   Private = DEVICE_IO_PRIVATE_DATA_FROM_THIS (This);\r
 \r
-  if (Width < 0 || Width >= MMIO_COPY_UINT8) {\r
+  if ((UINT32)Width >= MMIO_COPY_UINT8) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
@@ -805,7 +805,7 @@ DeviceIoPciWrite (
 \r
   Private = DEVICE_IO_PRIVATE_DATA_FROM_THIS (This);\r
 \r
-  if (Width < 0 || Width >= MMIO_COPY_UINT8) {\r
+  if ((UINT32)Width >= MMIO_COPY_UINT8) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
@@ -1029,7 +1029,7 @@ DeviceIoMap (
 \r
   Private = DEVICE_IO_PRIVATE_DATA_FROM_THIS (This);\r
 \r
-  if (Operation < 0 || Operation > EfiBusMasterCommonBuffer) {\r
+  if ((UINT32)Operation > EfiBusMasterCommonBuffer) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
@@ -1123,7 +1123,7 @@ DeviceIoAllocateBuffer (
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
-  if ((Type >= MaxAllocateType) || (Type < AllocateAnyPages)) {\r
+  if ((UINT32)Type >= MaxAllocateType) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
index 34ee6a5d523cc529fa2a85768b9d95554dfab8f8..aa21fa68def6c043d6316970ba965b22834330be 100644 (file)
@@ -1,6 +1,6 @@
 /*++ @file
 
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
 Portions copyright (c) 2010 - 2011, Apple Inc. All rights reserved.
 This program and the accompanying materials
 are licensed and made available under the terms and conditions of the BSD License
@@ -208,7 +208,7 @@ EmuGopBlt (
 
   Private = GOP_PRIVATE_DATA_FROM_THIS (This);
 
-  if ((BltOperation < 0) || (BltOperation >= EfiGraphicsOutputBltOperationMax)) {
+  if ((UINT32)BltOperation >= EfiGraphicsOutputBltOperationMax) {
     return EFI_INVALID_PARAMETER;
   }
 
index e4715383eacf4442b6df6a7c01fd1af7ba89fd05..6f1cd1b8b11947124b455289f0c3c855a23e2b73 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   The implementation for EFI_ISA_IO_PROTOCOL. \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
@@ -439,8 +439,7 @@ IsaIoVerifyAccess (
   EFI_ISA_ACPI_RESOURCE *Item;\r
   EFI_STATUS            Status;\r
 \r
-  if (Width < EfiIsaIoWidthUint8 ||\r
-      Width >= EfiIsaIoWidthMaximum ||\r
+  if ((UINT32)Width >= EfiIsaIoWidthMaximum ||\r
       Width == EfiIsaIoWidthReserved ||\r
       Width == EfiIsaIoWidthFifoReserved ||\r
       Width == EfiIsaIoWidthFillReserved\r
@@ -1000,7 +999,7 @@ IsaIoMapFullSupport (
   //\r
   // Make sure the Operation parameter is valid\r
   //\r
-  if (Operation < 0 || Operation >= EfiIsaIoOperationMaximum) {\r
+  if ((UINT32)Operation >= EfiIsaIoOperationMaximum) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
@@ -1378,7 +1377,7 @@ IsaIoAllocateBuffer (
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
-  if (Type < AllocateAnyPages || Type >= MaxAllocateType) {\r
+  if ((UINT32)Type >= MaxAllocateType) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
   //\r
index ab2a9a5f92045903a50ba2f25b363faffc673c6f..2e4361fc0d5e22f669d2ac547499f06ff16f1993 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   The implementation for EFI_ISA_IO_PROTOCOL. \r
   \r
-Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2010 - 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
@@ -105,8 +105,7 @@ IsaIoVerifyAccess (
   EFI_ISA_ACPI_RESOURCE *Item;\r
   EFI_STATUS            Status;\r
 \r
-  if (Width < EfiIsaIoWidthUint8 ||\r
-      Width >= EfiIsaIoWidthMaximum ||\r
+  if ((UINT32)Width >= EfiIsaIoWidthMaximum ||\r
       Width == EfiIsaIoWidthReserved ||\r
       Width == EfiIsaIoWidthFifoReserved ||\r
       Width == EfiIsaIoWidthFillReserved\r
@@ -1340,7 +1339,7 @@ IsaIoMapFullSupport (
   //\r
   // Make sure the Operation parameter is valid\r
   //\r
-  if (Operation < 0 || Operation >= EfiIsaIoOperationMaximum) {\r
+  if ((UINT32)Operation >= EfiIsaIoOperationMaximum) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
@@ -1718,7 +1717,7 @@ IsaIoAllocateBuffer (
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
-  if (Type < AllocateAnyPages || Type >= MaxAllocateType) {\r
+  if ((UINT32)Type >= MaxAllocateType) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
   //\r
index 3865a7cfe0d91d0c92684eab73de852ef1327db5..e48b6382ff2c9aa1ce10ac3e3ae355ca967284af 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Uses the services of the I/O Library to produce the CPU I/O Protocol\r
 \r
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 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
@@ -116,7 +116,7 @@ CpuIoCheckParameter (
   //\r
   // Check to see if Width is in the valid range\r
   //\r
-  if (Width < 0 || Width >= EfiCpuIoWidthMaximum) {\r
+  if ((UINT32)Width >= EfiCpuIoWidthMaximum) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
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
index 1b20e327cdadec1f61720d3b7009fbd71eaa90cb..3b17ae917cef7d1a50d6a260b2b83a20c2fca7de 100644 (file)
@@ -261,7 +261,7 @@ CoreSetTimer (
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
-  if (Type < 0 || Type > TimerRelative  || (Event->Type & EVT_TIMER) == 0) {\r
+  if ((UINT32)Type > TimerRelative  || (Event->Type & EVT_TIMER) == 0) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
index 49697ae89c0535a7ae9dbfca0fcee8e8c5e434d1..c351d215dc284b5ac94259b5c055fe2ed353b4cf 100644 (file)
@@ -3,7 +3,7 @@
   The GCD services are used to manage the memory and I/O regions that\r
   are accessible to the CPU that is executing the DXE core.\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
@@ -1012,15 +1012,15 @@ CoreAllocateSpace (
   //\r
   // Make sure parameters are valid\r
   //\r
-  if (GcdAllocateType < 0 || GcdAllocateType >= EfiGcdMaxAllocateType) {\r
+  if ((UINT32)GcdAllocateType >= EfiGcdMaxAllocateType) {\r
     DEBUG ((DEBUG_GCD, "  Status = %r\n", EFI_INVALID_PARAMETER));\r
     return EFI_INVALID_PARAMETER;\r
   }\r
-  if (GcdMemoryType < 0 || GcdMemoryType >= EfiGcdMemoryTypeMaximum) {\r
+  if ((UINT32)GcdMemoryType >= EfiGcdMemoryTypeMaximum) {\r
     DEBUG ((DEBUG_GCD, "  Status = %r\n", EFI_INVALID_PARAMETER));\r
     return EFI_INVALID_PARAMETER;\r
   }\r
-  if (GcdIoType < 0 || GcdIoType >= EfiGcdIoTypeMaximum) {\r
+  if ((UINT32)GcdIoType >= EfiGcdIoTypeMaximum) {\r
     DEBUG ((DEBUG_GCD, "  Status = %r\n", EFI_INVALID_PARAMETER));\r
     return EFI_INVALID_PARAMETER;\r
   }\r
index b4a62b9f0c4988462a24e03cc854ed1b780199b9..6d5a259eb669dc7a462e0c217ecd28ba6325d07e 100644 (file)
@@ -557,7 +557,7 @@ CoreAddMemoryDescriptor (
     // Make sure the memory type in the gMemoryTypeInformation[] array is valid\r
     //\r
     Type = (EFI_MEMORY_TYPE) (gMemoryTypeInformation[Index].Type);\r
-    if (Type < 0 || Type > EfiMaxMemoryType) {\r
+    if ((UINT32)Type > EfiMaxMemoryType) {\r
       continue;\r
     }\r
     if (gMemoryTypeInformation[Index].NumberOfPages != 0) {\r
@@ -581,7 +581,7 @@ CoreAddMemoryDescriptor (
           // Make sure the memory type in the gMemoryTypeInformation[] array is valid\r
           //\r
           Type = (EFI_MEMORY_TYPE) (gMemoryTypeInformation[FreeIndex].Type);\r
-          if (Type < 0 || Type > EfiMaxMemoryType) {\r
+          if ((UINT32)Type > EfiMaxMemoryType) {\r
             continue;\r
           }\r
 \r
@@ -624,7 +624,7 @@ CoreAddMemoryDescriptor (
     // Make sure the memory type in the gMemoryTypeInformation[] array is valid\r
     //\r
     Type = (EFI_MEMORY_TYPE) (gMemoryTypeInformation[Index].Type);\r
-    if (Type < 0 || Type > EfiMaxMemoryType) {\r
+    if ((UINT32)Type > EfiMaxMemoryType) {\r
       continue;\r
     }\r
     if (gMemoryTypeInformation[Index].NumberOfPages != 0) {\r
@@ -747,7 +747,7 @@ CoreConvertPages (
     //\r
     // Update counters for the number of pages allocated to each memory type\r
     //\r
-    if (Entry->Type >= 0 && Entry->Type < EfiMaxMemoryType) {\r
+    if ((UINT32)Entry->Type < EfiMaxMemoryType) {\r
       if ((Start >= mMemoryTypeStatistics[Entry->Type].BaseAddress && Start <= mMemoryTypeStatistics[Entry->Type].MaximumAddress) ||\r
           (Start >= mDefaultBaseAddress && Start <= mDefaultMaximumAddress)                                                          ) {\r
         if (NumberOfPages > mMemoryTypeStatistics[Entry->Type].CurrentNumberOfPages) {\r
@@ -758,7 +758,7 @@ CoreConvertPages (
       }\r
     }\r
 \r
-    if (NewType >= 0 && NewType < EfiMaxMemoryType) {\r
+    if ((UINT32)NewType < EfiMaxMemoryType) {\r
       if ((Start >= mMemoryTypeStatistics[NewType].BaseAddress && Start <= mMemoryTypeStatistics[NewType].MaximumAddress) ||\r
           (Start >= mDefaultBaseAddress && Start <= mDefaultMaximumAddress)                                                  ) {\r
         mMemoryTypeStatistics[NewType].CurrentNumberOfPages += NumberOfPages;\r
@@ -1011,7 +1011,7 @@ FindFreePages (
   //\r
   // Attempt to find free pages in the preferred bin based on the requested memory type\r
   //\r
-  if (NewType >= 0 && NewType < EfiMaxMemoryType && MaxAddress >= mMemoryTypeStatistics[NewType].MaximumAddress) {\r
+  if ((UINT32)NewType < EfiMaxMemoryType && MaxAddress >= mMemoryTypeStatistics[NewType].MaximumAddress) {\r
     Start = CoreFindFreePagesI (\r
               mMemoryTypeStatistics[NewType].MaximumAddress, \r
               mMemoryTypeStatistics[NewType].BaseAddress, \r
@@ -1094,7 +1094,7 @@ CoreAllocatePages (
   UINT64          MaxAddress;\r
   UINTN           Alignment;\r
 \r
-  if (Type < AllocateAnyPages || Type >= (UINTN) MaxAllocateType) {\r
+  if ((UINT32)Type >= MaxAllocateType) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
index cdf3f8f095cc925cc8ce7f397d9eceb761791680..e0f0869e53df5ea1b552fce780290c11ff3894e2 100644 (file)
@@ -120,7 +120,7 @@ LookupPoolHead (
   POOL            *Pool;\r
   UINTN           Index;\r
 \r
-  if (MemoryType >= 0 && MemoryType < EfiMaxMemoryType) {\r
+  if ((UINT32)MemoryType < EfiMaxMemoryType) {\r
     return &mPoolHead[MemoryType];\r
   }\r
 \r
@@ -550,7 +550,7 @@ CoreFreePoolI (
   // portion of that memory type has been freed.  If it has, then free the\r
   // list entry for that memory type\r
   //\r
-  if (Pool->MemoryType < 0 && Pool->Used == 0) {\r
+  if ((INT32)Pool->MemoryType < 0 && Pool->Used == 0) {\r
     RemoveEntryList (&Pool->Link);\r
     CoreFreePoolI (Pool);\r
   }\r
index d4b3eafb273828ef4114d840f8f4cc21037089a9..4550b25010477fc281822b419594c36e327f1897 100644 (file)
@@ -1,5 +1,5 @@
 /** @file\r
-Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 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
@@ -240,7 +240,7 @@ Returns:
 \r
   Private = CIRRUS_LOGIC_5430_PRIVATE_DATA_FROM_GRAPHICS_OUTPUT_THIS (This);\r
 \r
-  if ((BltOperation < 0) || (BltOperation >= EfiGraphicsOutputBltOperationMax)) {\r
+  if ((UINT32)BltOperation >= EfiGraphicsOutputBltOperationMax) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
index a1c14130d9f831c248c8f365cfa1b2dc67094398..0f208815ea382975f85866e44fa3d79a33982da0 100644 (file)
@@ -3,7 +3,7 @@
   CirrusLogic5430.c file which deals with the EFI 1.1 driver model.\r
   This file just does graphics.\r
 \r
-  Copyright (c) 2006, 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
@@ -136,7 +136,7 @@ CirrusLogic5430UgaDrawBlt (
 \r
   Private = CIRRUS_LOGIC_5430_PRIVATE_DATA_FROM_UGA_DRAW_THIS (This);\r
 \r
-  if ((BltOperation < 0) || (BltOperation >= EfiUgaBltMax)) {\r
+  if ((UINT32)BltOperation >= EfiUgaBltMax) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
index 5a862d13b8021d823b59c48ecafbf4e90ab4bb77..447106afe92ce60eff749a6e5296ec0c7b6c6fee 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   This contains the installation function for the driver.\r
 \r
-Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2005 - 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
@@ -413,7 +413,7 @@ Interrupt8259GetVector (
   OUT UINT8                     *Vector\r
   )\r
 {\r
-  if (Irq < Efi8259Irq0 || Irq > Efi8259Irq15) {\r
+  if ((UINT32)Irq > Efi8259Irq15) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
@@ -445,7 +445,7 @@ Interrupt8259EnableIrq (
   IN BOOLEAN                   LevelTriggered\r
   )\r
 {\r
-  if (Irq < Efi8259Irq0 || Irq > Efi8259Irq15) {\r
+  if ((UINT32)Irq > Efi8259Irq15) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
@@ -478,7 +478,7 @@ Interrupt8259DisableIrq (
   IN EFI_8259_IRQ              Irq\r
   )\r
 {\r
-  if (Irq < Efi8259Irq0 || Irq > Efi8259Irq15) {\r
+  if ((UINT32)Irq > Efi8259Irq15) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
@@ -555,7 +555,7 @@ Interrupt8259EndOfInterrupt (
   IN EFI_8259_IRQ              Irq\r
   )\r
 {\r
-  if (Irq < Efi8259Irq0 || Irq > Efi8259Irq15) {\r
+  if ((UINT32)Irq > Efi8259Irq15) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
index a6c1d130ab058a43ab9bf23f23dad63bbc8566fa..994bfeb60452fe7075388aad48e208339b873f11 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Provides the basic interfaces to abstract a PCI Host Bridge Resource Allocation\r
 \r
-Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials are\r
 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
@@ -1180,7 +1180,7 @@ PreprocessController (
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
-  if (Phase < EfiPciBeforeChildBusEnumeration || Phase > EfiPciBeforeResourceCollection) {\r
+  if ((UINT32)Phase > EfiPciBeforeResourceCollection) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
index b4da52eefe076899eb46dc440d47570378900f16..7946324d9f674525c5e098c43288ac21adcca8be 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   PCI Root Bridge Io Protocol implementation\r
 \r
-Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials are\r
 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
@@ -770,7 +770,7 @@ RootBridgeIoCheckParameter (
   //\r
   // Check to see if Width is in the valid range\r
   //\r
-  if (Width < EfiPciWidthUint8 || Width >= EfiPciWidthMaximum) {\r
+  if ((UINT32)Width >= EfiPciWidthMaximum) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
@@ -1233,7 +1233,7 @@ RootBridgeIoPollMem (
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
-  if (Width < 0 || Width > EfiPciWidthUint64) {\r
+  if ((UINT32)Width > EfiPciWidthUint64) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
@@ -1340,7 +1340,7 @@ RootBridgeIoPollIo (
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
-  if (Width < 0 || Width > EfiPciWidthUint64) {\r
+  if ((UINT32)Width > EfiPciWidthUint64) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
   \r
@@ -1561,7 +1561,7 @@ RootBridgeIoCopyMem (
   UINTN       Index;\r
   UINT64      Result;\r
 \r
-  if (Width < 0 || Width > EfiPciWidthUint64) {\r
+  if ((UINT32)Width > EfiPciWidthUint64) {\r
     return EFI_INVALID_PARAMETER;\r
   }    \r
 \r
@@ -1735,7 +1735,7 @@ RootBridgeIoMap (
   //\r
   // Make sure that Operation is valid\r
   //\r
-  if (Operation < 0 || Operation >= EfiPciOperationMaximum) {\r
+  if ((UINT32)Operation >= EfiPciOperationMaximum) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
index 802342caaebd1396f17cdd6144a90e1c67d8571c..3d8a79923025bd74c8ec8de4d804ff9bc4d4aecf 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Produces the CPU I/O 2 Protocol.\r
 \r
-Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2009 - 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
@@ -116,7 +116,7 @@ CpuIoCheckParameter (
   //\r
   // Check to see if Width is in the valid range\r
   //\r
-  if (Width < 0 || Width >= EfiCpuIoWidthMaximum) {\r
+  if ((UINT32)Width >= EfiCpuIoWidthMaximum) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
index 1c172a096c858bbb58e50b0a61c962c8ce6be48e..7b1ad37515ce0452c20e48b90f15d1099c1e12c6 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Produces the SMM CPU I/O Protocol.\r
 \r
-Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2009 - 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
@@ -82,7 +82,7 @@ CpuIoCheckParameter (
   //\r
   // Check to see if Width is in the valid range\r
   //\r
-  if (Width < 0 || Width > SMM_IO_UINT64) {\r
+  if ((UINT32)Width > SMM_IO_UINT64) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
index 67b79053935710f1c2deb2a403cc45bfc5b0cceb..3c5c8a74b3a684f451dcf9bf7aba230a4c8bd874 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Produces the CPU I/O PPI.\r
 \r
-Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2009 - 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
@@ -127,7 +127,7 @@ CpuIoCheckParameter (
   //\r
   // Check to see if Width is in the valid range\r
   //\r
-  if (Width < 0 || Width >= EfiPeiCpuIoWidthMaximum) {\r
+  if ((UINT32)Width >= EfiPeiCpuIoWidthMaximum) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r