]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c
1) Add type cast for better coding style.
[mirror_edk2.git] / MdeModulePkg / Bus / Pci / XhciPei / XhciSched.c
index 3ae151122240001d5b7170e788ae1d8c686dfee8..dde31e0f1a580f294a14835f1f96894677b70885 100644 (file)
@@ -1754,8 +1754,8 @@ XhcPeiSetConfigCmd (
                   ((TRANSFER_RING *) (UINTN) Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci-1])->RingSeg0,\r
                   sizeof (TRB_TEMPLATE) * TR_RING_TRB_NUMBER\r
                   );\r
-      PhyAddr &= ~(0x0F);\r
-      PhyAddr |= ((TRANSFER_RING *) (UINTN) Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci-1])->RingPCS;\r
+      PhyAddr &= ~((EFI_PHYSICAL_ADDRESS)0x0F);\r
+      PhyAddr |= (EFI_PHYSICAL_ADDRESS)((TRANSFER_RING *) (UINTN) Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci-1])->RingPCS;\r
       InputContext->EP[Dci-1].PtrLo = XHC_LOW_32BIT (PhyAddr);\r
       InputContext->EP[Dci-1].PtrHi = XHC_HIGH_32BIT (PhyAddr);\r
 \r
@@ -1948,8 +1948,8 @@ XhcPeiSetConfigCmd64 (
                   sizeof (TRB_TEMPLATE) * TR_RING_TRB_NUMBER\r
                   );\r
 \r
-      PhyAddr &= ~(0x0F);\r
-      PhyAddr |= ((TRANSFER_RING *) (UINTN) Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci-1])->RingPCS;\r
+      PhyAddr &= ~((EFI_PHYSICAL_ADDRESS)0x0F);\r
+      PhyAddr |= (EFI_PHYSICAL_ADDRESS)((TRANSFER_RING *) (UINTN) Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci-1])->RingPCS;\r
 \r
       InputContext->EP[Dci-1].PtrLo = XHC_LOW_32BIT (PhyAddr);\r
       InputContext->EP[Dci-1].PtrHi = XHC_HIGH_32BIT (PhyAddr);\r
@@ -2618,6 +2618,7 @@ XhcPeiInitSched (
     ASSERT (ScratchEntry != NULL);\r
     Xhc->ScratchEntry = ScratchEntry;\r
 \r
+    ScratchPhy = 0;\r
     Status = UsbHcAllocateAlignedPages (\r
                EFI_SIZE_TO_PAGES (MaxScratchpadBufs * sizeof (UINT64)),\r
                Xhc->PageSize,\r
@@ -2633,6 +2634,7 @@ XhcPeiInitSched (
     // Allocate each scratch buffer\r
     //\r
     for (Index = 0; Index < MaxScratchpadBufs; Index++) {\r
+      ScratchEntryPhy = 0;\r
       Status = UsbHcAllocateAlignedPages (\r
                  EFI_SIZE_TO_PAGES (Xhc->PageSize),\r
                  Xhc->PageSize,\r