]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/PciBus: Refine ActiveVGADeviceOnTheRootBridge
authorRuiyu Ni <ruiyu.ni@intel.com>
Thu, 23 Aug 2018 02:34:33 +0000 (10:34 +0800)
committerRuiyu Ni <ruiyu.ni@intel.com>
Mon, 27 Aug 2018 01:40:21 +0000 (09:40 +0800)
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1109
The patch doesn't change any behavior of this function.
It just renames the function to LocateVgaDevice() and renames
some parameters and local variables.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c
MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.h

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
index c282381f85dc01f316a3a5347643bbe8f1a051f1..1ec2178a21ca870423e8f0463378453578244086 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Supporting functions declaration for PCI devices management.\r
 \r
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2018, 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
@@ -243,16 +243,16 @@ 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
 \r