]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkCompatibilityPkg/Compatibility/DeviceIoOnPciRootBridgeIoThunk/DeviceIoOnPciRootBridgeIoThunk.c
SecurityPkg: Add TPM PTP support in TPM2 device lib.
[mirror_edk2.git] / EdkCompatibilityPkg / Compatibility / DeviceIoOnPciRootBridgeIoThunk / DeviceIoOnPciRootBridgeIoThunk.c
index b5ce020458cc81df86dee0e5a975a9b16e14013c..da55e12178938b8a8addb4be5fc7be98ede4778d 100644 (file)
@@ -7,13 +7,13 @@ drivers/apps that may have used Device I/O.
 Device I/O is on list of deprecated protocols for UEFI 2.0 and later.\r
 This module module layers Device I/O on top of PCI Root Bridge I/O (Segment 0)\r
  Use if:\r
-   There are no R8.x modules present that produces Device I/O\r
+   There are no EDK modules present that produces Device I/O\r
    EFI drivers included that consume Device I/O\r
    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 - 2010, Intel Corporation. <BR>\r
-All rights reserved. This program and the accompanying materials\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
 http://opensource.org/licenses/bsd-license.php\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
@@ -898,7 +898,7 @@ AppendPciDevicePath (
               return ReturnDevicePath;\r
             }\r
           }\r
-          if (ThisFunc == 0 && !(PciPtr->Hdr.HeaderType & HEADER_TYPE_MULTI_FUNCTION)) {\r
+          if (ThisFunc == 0 && ((PciPtr->Hdr.HeaderType & HEADER_TYPE_MULTI_FUNCTION) != HEADER_TYPE_MULTI_FUNCTION)) {\r
             //\r
             // Skip sub functions, this is not a multi function device\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