]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c
MdeModulePkg/PciBus: Refine ActiveVGADeviceOnTheRootBridge
[mirror_edk2.git] / MdeModulePkg / Bus / Pci / PciBusDxe / PciDeviceSupport.c
index f7039da99210b0252b7b15928b805d3db9e812a3..5a4b83060445e2fcbc035c6c2d308dfc18a6889b 100644 (file)
@@ -1002,7 +1002,7 @@ ActiveVGADeviceOnTheSameSegment (
 \r
     if (Temp->PciRootBridgeIo->SegmentNumber == VgaDevice->PciRootBridgeIo->SegmentNumber) {\r
 \r
-      Temp = ActiveVGADeviceOnTheRootBridge (Temp);\r
+      Temp = LocateVgaDevice (Temp);\r
 \r
       if (Temp != NULL) {\r
         return Temp;\r
@@ -1016,41 +1016,41 @@ ActiveVGADeviceOnTheSameSegment (
 }\r
 \r
 /**\r
-  Get the active VGA device on the root bridge.\r
+  Locate the active VGA device under the bridge.\r
 \r
-  @param RootBridge  PCI IO instance for the root bridge.\r
+  @param Bridge  PCI IO instance for the bridge.\r
 \r
   @return The active VGA device.\r
 \r
 **/\r
 PCI_IO_DEVICE *\r
-ActiveVGADeviceOnTheRootBridge (\r
-  IN PCI_IO_DEVICE        *RootBridge\r
+LocateVgaDevice (\r
+  IN PCI_IO_DEVICE        *Bridge\r
   )\r
 {\r
   LIST_ENTRY      *CurrentLink;\r
-  PCI_IO_DEVICE   *Temp;\r
+  PCI_IO_DEVICE   *PciIoDevice;\r
 \r
-  CurrentLink = RootBridge->ChildList.ForwardLink;\r
+  CurrentLink = Bridge->ChildList.ForwardLink;\r
 \r
-  while (CurrentLink != NULL && CurrentLink != &RootBridge->ChildList) {\r
+  while (CurrentLink != NULL && CurrentLink != &Bridge->ChildList) {\r
 \r
-    Temp = PCI_IO_DEVICE_FROM_LINK (CurrentLink);\r
+    PciIoDevice = PCI_IO_DEVICE_FROM_LINK (CurrentLink);\r
 \r
-    if (IS_PCI_VGA(&Temp->Pci) &&\r
-        (Temp->Attributes &\r
+    if (IS_PCI_VGA(&PciIoDevice->Pci) &&\r
+        (PciIoDevice->Attributes &\r
          (EFI_PCI_IO_ATTRIBUTE_VGA_MEMORY |\r
           EFI_PCI_IO_ATTRIBUTE_VGA_IO     |\r
           EFI_PCI_IO_ATTRIBUTE_VGA_IO_16)) != 0) {\r
-      return Temp;\r
+      return PciIoDevice;\r
     }\r
 \r
-    if (IS_PCI_BRIDGE (&Temp->Pci)) {\r
+    if (IS_PCI_BRIDGE (&PciIoDevice->Pci)) {\r
 \r
-      Temp = ActiveVGADeviceOnTheRootBridge (Temp);\r
+      PciIoDevice = LocateVgaDevice (PciIoDevice);\r
 \r
-      if (Temp != NULL) {\r
-        return Temp;\r
+      if (PciIoDevice != NULL) {\r
+        return PciIoDevice;\r
       }\r
     }\r
 \r
@@ -1060,6 +1060,3 @@ ActiveVGADeviceOnTheRootBridge (
   return NULL;\r
 }\r
 \r
-\r
-\r
-\r