Re: [PATCH v2 3/4] PCI: of: Simplify devm_of_pci_get_host_bridge_resources() interface

From: Bjorn Helgaas
Date: Wed Jan 15 2025 - 16:28:37 EST


On Tue, Jan 14, 2025 at 04:21:15PM -0800, Sathyanarayanan Kuppuswamy wrote:
> On 1/13/25 3:15 PM, Bjorn Helgaas wrote:
> > From: Bjorn Helgaas <bhelgaas@xxxxxxxxxx>
> >
> > Previously pci_parse_request_of_pci_ranges() supplied the default bus range
> > to devm_of_pci_get_host_bridge_resources(), but that function is static and
> > has no other callers, so there's no reason to complicate its interface by
> > passing the default bus range.
> >
> > Drop the busno and bus_max parameters and use 0x0 and 0xff directly in
> > devm_of_pci_get_host_bridge_resources().

> > } else {
> > - if (bus_range->end > bus_range->start + bus_max)
> > - bus_range->end = bus_range->start + bus_max;
> > + if (bus_range->end > 0xff) {
> > + dev_info(dev, " Invalid end bus number in %pR, defaulting to 0xff\n",
> > + bus_range);
>
> Use dev_warn() ? I noticed that dev_info() is used in place of
> warning/errors in this file.

Good point, changed.

> Probably it needs to be cleaned?
>
> > + bus_range->end = 0xff;