From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 1E214821CC for ; Sun, 19 Feb 2017 22:38:19 -0800 (PST) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP; 19 Feb 2017 22:38:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,185,1484035200"; d="scan'208";a="60354873" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga004.jf.intel.com with ESMTP; 19 Feb 2017 22:38:18 -0800 Received: from fmsmsx123.amr.corp.intel.com (10.18.125.38) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 19 Feb 2017 22:38:18 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx123.amr.corp.intel.com (10.18.125.38) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 19 Feb 2017 22:38:18 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.59]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.132]) with mapi id 14.03.0248.002; Mon, 20 Feb 2017 14:38:16 +0800 From: "Wu, Hao A" To: "Ni, Ruiyu" , "edk2-devel@lists.01.org" Thread-Topic: [edk2] [PATCH] MdeModulePkg/PciBusDxe: Refine code to make it more readable Thread-Index: AQHSi0I5ENvDQ2D3c0yf9565HLdE/aFxcFyA Date: Mon, 20 Feb 2017 06:38:15 +0000 Message-ID: References: <20170220062542.456028-1-ruiyu.ni@intel.com> In-Reply-To: <20170220062542.456028-1-ruiyu.ni@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] MdeModulePkg/PciBusDxe: Refine code to make it more readable X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Feb 2017 06:38:19 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Some minor comments below. With the changes: Reviewed-by: Hao Wu Best Regards, Hao Wu > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Ru= iyu > Ni > Sent: Monday, February 20, 2017 2:26 PM > To: edk2-devel@lists.01.org > Cc: Wu, Hao A > Subject: [edk2] [PATCH] MdeModulePkg/PciBusDxe: Refine code to make it > more readable >=20 > The patch doesn't impact functionality. >=20 > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Ruiyu Ni > Cc: Hao A Wu > --- > .../Bus/Pci/PciBusDxe/PciEnumeratorSupport.c | 24 ++++++++--------= ------ > 1 file changed, 9 insertions(+), 15 deletions(-) >=20 > diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c > b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c > index d9a83be..00b6622 100644 > --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c > +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c > @@ -1341,7 +1341,6 @@ UpdatePciInfo ( > { > EFI_STATUS Status; > UINTN BarIndex; > - UINTN BarEndIndex; > BOOLEAN SetFlag; > VOID *Configuration; > EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *Ptr; > @@ -1395,24 +1394,19 @@ UpdatePciInfo ( > break; > } >=20 > - if ((Ptr->AddrTranslationOffset =3D=3D MAX_UINT64) || (Ptr- > >AddrTranslationOffset =3D=3D MAX_UINT8)) { > + for (BarIndex =3D 0; BarIndex < PCI_MAX_BAR; BarIndex++) { > + if ((Ptr->AddrTranslationOffset !=3D MAX_UINT64) && > + (Ptr->AddrTranslationOffset !=3D MAX_UINT8) && > + (Ptr->AddrTranslationOffset !=3D BarIndex) > + ) { > // > - // Update all the bars in the device > + // Skip updating when AddrTranslationOffset is MAX_UINT64 or > MAX_UINT8 (wide match). According to the codes, the comment should be: Skip updating when TranslationOffset is not MAX_UINT64 or MAX_UINT8 (wide match). Right? > + // SKip updating when current BarIndex doesn't equal to Please fix 'SKip' as 'Skip'. > AddrTranslationOffset. > // Compare against MAX_UINT8 is to keep backward compatibility. > // > - BarIndex =3D 0; > - BarEndIndex =3D PCI_MAX_BAR - 1; > - } else { > - BarIndex =3D (UINTN) Ptr->AddrTranslationOffset; > - BarEndIndex =3D BarIndex; > - } > - > - if (BarIndex >=3D PCI_MAX_BAR) { > - Ptr++; > - continue; > - } > + continue; > + } >=20 > - for (; BarIndex <=3D BarEndIndex; BarIndex++) { > SetFlag =3D FALSE; > switch (Ptr->ResType) { > case ACPI_ADDRESS_SPACE_TYPE_MEM: > -- > 2.9.0.windows.1 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel