]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Pci/IdeBusPei/AtapiPeim.c
MdeModulePkg/PciBus: return CPU address for GetBarAttributes
[mirror_edk2.git] / MdeModulePkg / Bus / Pci / IdeBusPei / AtapiPeim.c
index be1b82920003c6a4f91fb7aad87c8c6732b7d823..58bef161fb37e8a2228aa1c41394d1f167b7f0c6 100644 (file)
@@ -5,7 +5,7 @@ ATA controllers in the platform.
 This PPI can be consumed by PEIM which produce gEfiPeiDeviceRecoveryModulePpiGuid\r
 for Atapi CD ROM device.\r
 \r
-Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>\r
 \r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions\r
@@ -593,7 +593,7 @@ AtapiEnumerateDevices (
       //\r
       // Pata & Sata, Primary & Secondary channel, Master & Slave device\r
       //\r
-      DevicePosition = (UINTN) (Index1 * 2 + Index2);\r
+      DevicePosition = Index1 * 2 + Index2;\r
 \r
       if (DiscoverAtapiDevice (AtapiBlkIoDev, DevicePosition, &MediaInfo, &MediaInfo2)) {\r
         //\r
@@ -2140,7 +2140,7 @@ ReadCapacity (
 \r
     if (MediaInfo->DeviceType == IdeCDROM) {\r
 \r
-      MediaInfo->LastBlock    = (Data.LastLba3 << 24) | (Data.LastLba2 << 16) | (Data.LastLba1 << 8) | Data.LastLba0;\r
+      MediaInfo->LastBlock    = ((UINT32) Data.LastLba3 << 24) | (Data.LastLba2 << 16) | (Data.LastLba1 << 8) | Data.LastLba0;\r
       MediaInfo->MediaPresent = TRUE;\r
       //\r
       // Because the user data portion in the sector of the Data CD supported\r
@@ -2161,7 +2161,7 @@ ReadCapacity (
         MediaInfo2->MediaPresent = FALSE;\r
         MediaInfo2->LastBlock    = 0;\r
       } else {\r
-        MediaInfo->LastBlock = (FormatData.LastLba3 << 24) |\r
+        MediaInfo->LastBlock = ((UINT32) FormatData.LastLba3 << 24) |\r
           (FormatData.LastLba2 << 16) |\r
           (FormatData.LastLba1 << 8) |\r
           FormatData.LastLba0;\r