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: <alpine.LFD.0.9999.0802151744330.3386@rancor.yyz.somanetworks.com>
Date:	Fri, 15 Feb 2008 17:45:47 -0500 (EST)
From:	Scott Murray <scottm@...anetworks.com>
To:	Greg Kroah-Hartman <gregkh@...e.de>
cc:	linux-pci@...ey.karlin.mff.cuni.cz, linux-kernel@...r.kernel.org,
	pcihpd-discuss@...ts.sourceforge.net,
	Kristen Carlson Accardi <kristen.c.accardi@...el.com>
Subject: Re: [PATCH 06/12] PCI Hotplug: make cpcihp driver use modern apis

On Thu, 14 Feb 2008, Greg Kroah-Hartman wrote:

> This removes the depandancy of the cpcihp driver from the PCI_LEGACY
> config option by removing its usage of the pci_find_bus() function.
>
>
> Cc: Kristen Carlson Accardi <kristen.c.accardi@...el.com>
> Cc: Scott Murray <scottm@...anetworks.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@...e.de>

Sorry for the slow reply, this looks fine to me.

Signed-off-by: Scott Murray <scottm@...anetworks.com>

Scott

> ---
>  drivers/pci/hotplug/Kconfig          |    2 +-
>  drivers/pci/hotplug/cpcihp_generic.c |    8 +++++++-
>  2 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pci/hotplug/Kconfig b/drivers/pci/hotplug/Kconfig
> index 2cdd832..17fb3d6 100644
> --- a/drivers/pci/hotplug/Kconfig
> +++ b/drivers/pci/hotplug/Kconfig
> @@ -119,7 +119,7 @@ config HOTPLUG_PCI_CPCI_ZT5550
>
>  config HOTPLUG_PCI_CPCI_GENERIC
>  	tristate "Generic port I/O CompactPCI Hotplug driver"
> -	depends on HOTPLUG_PCI_CPCI && X86 && PCI_LEGACY
> +	depends on HOTPLUG_PCI_CPCI && X86
>  	help
>  	  Say Y here if you have a CompactPCI system card that exposes the #ENUM
>  	  hotswap signal as a bit in a system register that can be read through
> diff --git a/drivers/pci/hotplug/cpcihp_generic.c b/drivers/pci/hotplug/cpcihp_generic.c
> index f3852a6..148fb46 100644
> --- a/drivers/pci/hotplug/cpcihp_generic.c
> +++ b/drivers/pci/hotplug/cpcihp_generic.c
> @@ -154,12 +154,18 @@ static int __init cpcihp_generic_init(void)
>  	if(!r)
>  		return -EBUSY;
>
> -	dev = pci_find_slot(bridge_busnr, PCI_DEVFN(bridge_slot, 0));
> +	bus = pci_find_bus(0, bridge_busnr);
> +	if (!bus) {
> +		err("Invalid bus number %d", bridge_busnr);
> +		return -EINVAL;
> +	}
> +	dev = pci_get_slot(bus, PCI_DEVFN(bridge_slot, 0));
>  	if(!dev || dev->hdr_type != PCI_HEADER_TYPE_BRIDGE) {
>  		err("Invalid bridge device %s", bridge);
>  		return -EINVAL;
>  	}
>  	bus = dev->subordinate;
> +	pci_dev_put(dev);
>
>  	memset(&generic_hpc, 0, sizeof (struct cpci_hp_controller));
>  	generic_hpc_ops.query_enum = query_enum;
>

-- 
Scott Murray
SOMA Networks, Inc.
Toronto, Ontario
e-mail: scottm@...anetworks.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ