lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250103213631.GA6246@bhelgaas>
Date: Fri, 3 Jan 2025 15:36:31 -0600
From: Bjorn Helgaas <helgaas@...nel.org>
To: Rob Herring <robh@...nel.org>
Cc: "David S . Miller" <davem@...emloft.net>,
	Andreas Larsson <andreas@...sler.com>, sparclinux@...r.kernel.org,
	linux-kernel@...r.kernel.org, linux-pci@...r.kernel.org,
	Bjorn Helgaas <bhelgaas@...gle.com>
Subject: Re: [PATCH 2/3] PCI: of: Simplify bus range parsing

On Fri, Jan 03, 2025 at 03:31:28PM -0600, Bjorn Helgaas wrote:
> From: Bjorn Helgaas <bhelgaas@...gle.com>
> 
> of_pci_parse_bus_range() looks for a DT "bus-range" property.  If none
> exists, devm_of_pci_get_host_bridge_resources() defaults to the [bus 00-ff]
> range supplied by its caller, pci_parse_request_of_pci_ranges().
> 
> devm_of_pci_get_host_bridge_resources() is static and has no other callers,
> so there's no reason to complicate its interface by passing the default bus
> range.

> @@ -343,8 +340,8 @@ static int devm_of_pci_get_host_bridge_resources(struct device *dev,
>  
>  	err = of_pci_parse_bus_range(dev_node, bus_range);
>  	if (err) {
> -		bus_range->start = busno;
> -		bus_range->end = bus_max;
> +		bus_range->start = 0;
> +		bus_range->end = 0xff;
>  		bus_range->flags = IORESOURCE_BUS;
>  		dev_info(dev, "  No bus range found for %pOF, using %pR\n",
>  			 dev_node, bus_range);

Hmm, would have been better if I'd compiled this first to notice the
build error, sorry about that:

  drivers/pci/of.c: In function ‘devm_of_pci_get_host_bridge_resources’:
  drivers/pci/of.c:349:57: error: ‘bus_max’ undeclared (first use in this function)
    349 |                 if (bus_range->end > bus_range->start + bus_max)
        |                                                         ^~~~~~~

Will fix.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ