Patchwork [15/29] PCI, edac: kill pci_find_next_bus in edac

login
register
mail settings
Submitter Yinghai Lu
Date Sept. 25, 2012, 8:26 a.m.
Message ID <1348561590-28067-16-git-send-email-yinghai@kernel.org>
Download mbox | patch
Permalink /patch/186723/
State Changes Requested
Headers show

Comments

Yinghai Lu - Sept. 25, 2012, 8:26 a.m.
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: Doug Thompson <dougthompson@xmission.com>
Cc: linux-edac@vger.kernel.org
---
 drivers/edac/i7core_edac.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
Mauro Carvalho Chehab - Sept. 25, 2012, 9:20 a.m.
Em Ter, 2012-09-25 às 01:26 -0700, Yinghai Lu escreveu:
> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
> Cc: Mauro Carvalho Chehab <mchehab@redhat.com>

Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>

> Cc: Doug Thompson <dougthompson@xmission.com>
> Cc: linux-edac@vger.kernel.org
> ---
>  drivers/edac/i7core_edac.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c
> index 3672101..ae4c484 100644
> --- a/drivers/edac/i7core_edac.c
> +++ b/drivers/edac/i7core_edac.c
> @@ -1294,10 +1294,10 @@ static void __init i7core_xeon_pci_fixup(const struct pci_id_table *table)
>  static unsigned i7core_pci_lastbus(void)
>  {
>  	int last_bus = 0, bus;
> -	struct pci_bus *b = NULL;
> +	struct pci_host_bridge *host_bridge = NULL;
>  
> -	while ((b = pci_find_next_bus(b)) != NULL) {
> -		bus = b->number;
> +	for_each_pci_host_bridge(host_bridge) {
> +		bus = host_bridge->bus->number;
>  		edac_dbg(0, "Found bus %d\n", bus);
>  		if (bus > last_bus)
>  			last_bus = bus;

--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c
index 3672101..ae4c484 100644
--- a/drivers/edac/i7core_edac.c
+++ b/drivers/edac/i7core_edac.c
@@ -1294,10 +1294,10 @@  static void __init i7core_xeon_pci_fixup(const struct pci_id_table *table)
 static unsigned i7core_pci_lastbus(void)
 {
 	int last_bus = 0, bus;
-	struct pci_bus *b = NULL;
+	struct pci_host_bridge *host_bridge = NULL;
 
-	while ((b = pci_find_next_bus(b)) != NULL) {
-		bus = b->number;
+	for_each_pci_host_bridge(host_bridge) {
+		bus = host_bridge->bus->number;
 		edac_dbg(0, "Found bus %d\n", bus);
 		if (bus > last_bus)
 			last_bus = bus;