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: <20241018170733.00007fe7@Huawei.com>
Date: Fri, 18 Oct 2024 17:07:33 +0100
From: Jonathan Cameron <Jonathan.Cameron@...wei.com>
To: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
CC: Bjorn Helgaas <bhelgaas@...gle.com>, <linux-pci@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 3/3] PCI: Use reverse logic in pci_read_bridge_bases()

On Thu, 17 Oct 2024 17:11:10 +0300
Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com> wrote:

> Use reverse logic combined with return and continue to allow
> significant reduction in indentation level in pci_read_bridge_bases().
> 
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@...wei.com>

> ---
>  drivers/pci/probe.c | 17 +++++++++--------
>  1 file changed, 9 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
> index 4243b1e6ece2..cc97dbda7e76 100644
> --- a/drivers/pci/probe.c
> +++ b/drivers/pci/probe.c
> @@ -543,14 +543,15 @@ void pci_read_bridge_bases(struct pci_bus *child)
>  	pci_read_bridge_mmio(child->self, child->resource[1], false);
>  	pci_read_bridge_mmio_pref(child->self, child->resource[2], false);
>  
> -	if (dev->transparent) {
> -		pci_bus_for_each_resource(child->parent, res) {
> -			if (res && res->flags) {
> -				pci_bus_add_resource(child, res);
> -				pci_info(dev, "  bridge window %pR (subtractive decode)\n",
> -					   res);
> -			}
> -		}
> +	if (!dev->transparent)
> +		return;
> +
> +	pci_bus_for_each_resource(child->parent, res) {
> +		if (!res || !res->flags)
> +			continue;
> +
> +		pci_bus_add_resource(child, res);
> +		pci_info(dev, "  bridge window %pR (subtractive decode)\n", res);
>  	}
>  }
>  


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ