From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.24; helo=mga09.intel.com; envelope-from=star.zeng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 0B472210FBEF0 for ; Fri, 24 Aug 2018 01:14:11 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Aug 2018 01:14:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,281,1531810800"; d="scan'208";a="65676529" Received: from shzintpr04.sh.intel.com (HELO [10.253.24.58]) ([10.239.4.101]) by fmsmga008.fm.intel.com with ESMTP; 24 Aug 2018 01:13:35 -0700 To: Ruiyu Ni , edk2-devel@lists.01.org, star.zeng@intel.com References: <20180823025353.137924-1-ruiyu.ni@intel.com> <20180823025353.137924-2-ruiyu.ni@intel.com> From: "Zeng, Star" Message-ID: <48f356be-1310-7d88-ae37-9b4c60d5e074@intel.com> Date: Fri, 24 Aug 2018 16:13:04 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180823025353.137924-2-ruiyu.ni@intel.com> Subject: Re: [PATCH 1/2] MdeModulePkg/PciBus: Refine ActiveVGADeviceOnTheRootBridge X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Aug 2018 08:14:12 -0000 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit On 2018/8/23 10:53, Ruiyu Ni wrote: > 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 > Cc: Star Zeng > --- > MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c | 35 +++++++++++------------ > MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.h | 10 +++---- > 2 files changed, 21 insertions(+), 24 deletions(-) > > diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c > index f7039da992..fdec0bcd53 100644 > --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c > +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c > @@ -1002,7 +1002,7 @@ ActiveVGADeviceOnTheSameSegment ( > > if (Temp->PciRootBridgeIo->SegmentNumber == VgaDevice->PciRootBridgeIo->SegmentNumber) { > > - Temp = ActiveVGADeviceOnTheRootBridge (Temp); > + Temp = LocateVgaDevice (Temp); > > if (Temp != NULL) { > return Temp; > @@ -1016,41 +1016,41 @@ ActiveVGADeviceOnTheSameSegment ( > } > > /** > - Get the active VGA device on the root bridge. > + Locate the active VGA device under the bridge. > > - @param RootBridge PCI IO instance for the root bridge. > + @param Bridge PCI IO instance for the bridge. > > @return The active VGA device. > > **/ > PCI_IO_DEVICE * > -ActiveVGADeviceOnTheRootBridge ( > - IN PCI_IO_DEVICE *RootBridge > +LocateVgaDevice ( > + IN PCI_IO_DEVICE *Bridge > ) > { > LIST_ENTRY *CurrentLink; > - PCI_IO_DEVICE *Temp; > + PCI_IO_DEVICE *PciIo; How about using PciIoDev as the local variable name? PciIo makes me regard it for PciIo protocol at the first glance. :) With the new name, Reviewed-by: Star Zeng Thanks, Star > > - CurrentLink = RootBridge->ChildList.ForwardLink; > + CurrentLink = Bridge->ChildList.ForwardLink; > > - while (CurrentLink != NULL && CurrentLink != &RootBridge->ChildList) { > + while (CurrentLink != NULL && CurrentLink != &Bridge->ChildList) { > > - Temp = PCI_IO_DEVICE_FROM_LINK (CurrentLink); > + PciIo = PCI_IO_DEVICE_FROM_LINK (CurrentLink); > > - if (IS_PCI_VGA(&Temp->Pci) && > - (Temp->Attributes & > + if (IS_PCI_VGA(&PciIo->Pci) && > + (PciIo->Attributes & > (EFI_PCI_IO_ATTRIBUTE_VGA_MEMORY | > EFI_PCI_IO_ATTRIBUTE_VGA_IO | > EFI_PCI_IO_ATTRIBUTE_VGA_IO_16)) != 0) { > - return Temp; > + return PciIo; > } > > - if (IS_PCI_BRIDGE (&Temp->Pci)) { > + if (IS_PCI_BRIDGE (&PciIo->Pci)) { > > - Temp = ActiveVGADeviceOnTheRootBridge (Temp); > + PciIo = LocateVgaDevice (PciIo); > > - if (Temp != NULL) { > - return Temp; > + if (PciIo != NULL) { > + return PciIo; > } > } > > @@ -1060,6 +1060,3 @@ ActiveVGADeviceOnTheRootBridge ( > return NULL; > } > > - > - > - > diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.h b/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.h > index c282381f85..1ec2178a21 100644 > --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.h > +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.h > @@ -1,7 +1,7 @@ > /** @file > Supporting functions declaration for PCI devices management. > > -Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.
> +Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
> This program and the accompanying materials > are licensed and made available under the terms and conditions of the BSD License > which accompanies this distribution. The full text of the license may be found at > @@ -243,16 +243,16 @@ ActiveVGADeviceOnTheSameSegment ( > ); > > /** > - Get the active VGA device on the root bridge. > + Locate the active VGA device under the bridge. > > - @param RootBridge PCI IO instance for the root bridge. > + @param Bridge PCI IO instance for the bridge. > > @return The active VGA device. > > **/ > PCI_IO_DEVICE * > -ActiveVGADeviceOnTheRootBridge ( > - IN PCI_IO_DEVICE *RootBridge > +LocateVgaDevice ( > + IN PCI_IO_DEVICE *Bridge > ); > > >