public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Wu, Hao A" <hao.a.wu@intel.com>
To: "Ni, Ruiyu" <ruiyu.ni@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Subject: Re: [PATCH] MdeModulePkg/PciBusDxe: Refine code to make it more readable
Date: Mon, 20 Feb 2017 06:38:15 +0000	[thread overview]
Message-ID: <B80AF82E9BFB8E4FBD8C89DA810C6A0931C746C9@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <20170220062542.456028-1-ruiyu.ni@intel.com>

Some minor comments below.

With the changes:
Reviewed-by: Hao Wu <hao.a.wu@intel.com>

Best Regards,
Hao Wu


> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Ruiyu
> 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
> 
> The patch doesn't impact functionality.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
> Cc: Hao A Wu <hao.a.wu@intel.com>
> ---
>  .../Bus/Pci/PciBusDxe/PciEnumeratorSupport.c       | 24 ++++++++--------------
>  1 file changed, 9 insertions(+), 15 deletions(-)
> 
> 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;
>      }
> 
> -    if ((Ptr->AddrTranslationOffset == MAX_UINT64) || (Ptr-
> >AddrTranslationOffset == MAX_UINT8)) {
> +    for (BarIndex = 0; BarIndex < PCI_MAX_BAR; BarIndex++) {
> +      if ((Ptr->AddrTranslationOffset != MAX_UINT64) &&
> +          (Ptr->AddrTranslationOffset != MAX_UINT8) &&
> +          (Ptr->AddrTranslationOffset != 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    = 0;
> -      BarEndIndex = PCI_MAX_BAR - 1;
> -    } else {
> -      BarIndex    = (UINTN) Ptr->AddrTranslationOffset;
> -      BarEndIndex = BarIndex;
> -    }
> -
> -    if (BarIndex >= PCI_MAX_BAR) {
> -      Ptr++;
> -      continue;
> -    }
> +        continue;
> +      }
> 
> -    for (; BarIndex <= BarEndIndex; BarIndex++) {
>        SetFlag = FALSE;
>        switch (Ptr->ResType) {
>        case ACPI_ADDRESS_SPACE_TYPE_MEM:
> --
> 2.9.0.windows.1
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


      reply	other threads:[~2017-02-20  6:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-20  6:25 [PATCH] MdeModulePkg/PciBusDxe: Refine code to make it more readable Ruiyu Ni
2017-02-20  6:38 ` Wu, Hao A [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=B80AF82E9BFB8E4FBD8C89DA810C6A0931C746C9@SHSMSX104.ccr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox