]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c
fix a invalid pointer conversion when builing 32bit image.
[mirror_edk2.git] / MdeModulePkg / Bus / Ata / AtaAtapiPassThru / AtaAtapiPassThru.c
index f90846ad154dc5eea2f814e321810938ba308d00..ca64df7f6bbf3f21d142ea9fa76cfdc3f59a8294 100644 (file)
@@ -2,7 +2,7 @@
   This file implements ATA_PASSTHRU_PROCTOCOL and EXT_SCSI_PASSTHRU_PROTOCOL interfaces\r
   for managed ATA controllers.\r
     \r
-  Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2010 - 2011, 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
@@ -303,23 +303,8 @@ AtaAtapiPassThruSupported (
                         PciData.Hdr.ClassCode\r
                         );\r
   if (EFI_ERROR (Status)) {\r
-    gBS->CloseProtocol (\r
-           Controller,\r
-           &gEfiPciIoProtocolGuid,\r
-           This->DriverBindingHandle,\r
-           Controller\r
-           );\r
     return EFI_UNSUPPORTED;\r
   }\r
-  //\r
-  // Close PciIo protocol as we have gotten the PciData.\r
-  //\r
-  gBS->CloseProtocol (\r
-         Controller,\r
-         &gEfiPciIoProtocolGuid,\r
-         This->DriverBindingHandle,\r
-         Controller\r
-         );\r
 \r
   if (IS_PCI_IDE (&PciData) || IS_PCI_SATADPA (&PciData)) {\r
     return EFI_SUCCESS;\r
@@ -625,7 +610,7 @@ AtaAtapiPassThruStop (
              );\r
     PciIo->FreeBuffer (\r
              PciIo,\r
-             EFI_SIZE_TO_PAGES (AhciRegisters->MaxCommandTableSize),\r
+             EFI_SIZE_TO_PAGES ((UINTN) AhciRegisters->MaxCommandTableSize),\r
              AhciRegisters->AhciCommandTable\r
              );\r
     PciIo->Unmap (\r
@@ -634,7 +619,7 @@ AtaAtapiPassThruStop (
              );\r
     PciIo->FreeBuffer (\r
              PciIo,\r
-             EFI_SIZE_TO_PAGES (AhciRegisters->MaxCommandListSize),\r
+             EFI_SIZE_TO_PAGES ((UINTN) AhciRegisters->MaxCommandListSize),\r
              AhciRegisters->AhciCmdList\r
              );\r
     PciIo->Unmap (\r
@@ -643,7 +628,7 @@ AtaAtapiPassThruStop (
              );\r
     PciIo->FreeBuffer (\r
              PciIo,\r
-             EFI_SIZE_TO_PAGES (AhciRegisters->MaxReceiveFisSize),\r
+             EFI_SIZE_TO_PAGES ((UINTN) AhciRegisters->MaxReceiveFisSize),\r
              AhciRegisters->AhciRFis\r
              );\r
   }\r