On 2015-07-08 02:20:45, Laszlo Ersek wrote:
> >>    //
> >> +  // QEMU provides the number of extra root buses, shortening the 
> >> exhaustive
> >> +  // search below. If there is no hint, the feature is missing.
> >> +  //
> >> +  Status = QemuFwCfgFindFile ("etc/extra-pci-roots", &FwCfgItem, 
> >> &FwCfgSize);
> >> +  if (EFI_ERROR (Status) || FwCfgSize != sizeof ExtraRootBridgesLeft) {
> >> +    ExtraRootBridgesLeft = 0;
> 
> If QemuFwCfgFindFile() doesn't find the fw_cfg file, then it returns
> NOT_FOUND. That will set ExtraRootBridgesLeft to zero, and then:
> 
> >> +  } else {
> >> +    QemuFwCfgSelectItem (FwCfgItem);
> >> +    QemuFwCfgReadBytes (FwCfgSize, &ExtraRootBridgesLeft);
> >> +    DEBUG ((EFI_D_INFO, "%a: %Lu extra root buses reported by QEMU\n",
> >> +      __FUNCTION__, ExtraRootBridgesLeft));
> >> +  }
> >> +
> >> +  //
> >>    // The "main" root bus is always there.
> >>    //
> >>    LastRootBridgeNumber = 0;
> >> @@ -247,7 +266,7 @@ InitializePciHostBridge (
> >>    // alive.
> >>    //
> >>    for (RootBridgeNumber = 1;
> >> -       RootBridgeNumber < 256;
> >> +       RootBridgeNumber < 256 && ExtraRootBridgesLeft > 0;
> 
> this condition here will prevent the loop body from executing even once.

Ok. Yeah, that looks good.

20-21 Reviewed-by: Jordan Justen <jordan.l.jus...@intel.com>

------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to