All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/6] PCI,acpiphp: Use list_for_each_entry() for bus traversal
@ 2014-02-13 13:13 ` Yijing Wang
  0 siblings, 0 replies; 30+ messages in thread
From: Yijing Wang @ 2014-02-13 13:13 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Russell King, David Airlie, dri-devel, Benjamin Herrenschmidt,
	linuxppc-dev, linux-pcmcia, linux-pci, Yijing Wang, Hanjun Guo

Replace list_for_each() + pci_bus_b() with the simpler
list_for_each_entry().

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
 drivers/pci/hotplug/acpiphp_glue.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index cd929ae..aee6a0a 100644
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -450,7 +450,7 @@ static void cleanup_bridge(struct acpiphp_bridge *bridge)
  */
 static unsigned char acpiphp_max_busnr(struct pci_bus *bus)
 {
-	struct list_head *tmp;
+	struct pci_bus *tmp;
 	unsigned char max, n;
 
 	/*
@@ -463,8 +463,8 @@ static unsigned char acpiphp_max_busnr(struct pci_bus *bus)
 	 */
 	max = bus->busn_res.start;
 
-	list_for_each(tmp, &bus->children) {
-		n = pci_bus_max_busnr(pci_bus_b(tmp));
+	list_for_each_entry(tmp, &bus->children, node) {
+		n = pci_bus_max_busnr(tmp);
 		if (n > max)
 			max = n;
 	}
-- 
1.7.1



^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 1/6] PCI,acpiphp: Use list_for_each_entry() for bus traversal
@ 2014-02-13 13:13 ` Yijing Wang
  0 siblings, 0 replies; 30+ messages in thread
From: Yijing Wang @ 2014-02-13 13:13 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Russell King, David Airlie, linux-pcmcia, Hanjun Guo, dri-devel,
	linux-pci, Yijing Wang, linuxppc-dev

Replace list_for_each() + pci_bus_b() with the simpler
list_for_each_entry().

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
 drivers/pci/hotplug/acpiphp_glue.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index cd929ae..aee6a0a 100644
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -450,7 +450,7 @@ static void cleanup_bridge(struct acpiphp_bridge *bridge)
  */
 static unsigned char acpiphp_max_busnr(struct pci_bus *bus)
 {
-	struct list_head *tmp;
+	struct pci_bus *tmp;
 	unsigned char max, n;
 
 	/*
@@ -463,8 +463,8 @@ static unsigned char acpiphp_max_busnr(struct pci_bus *bus)
 	 */
 	max = bus->busn_res.start;
 
-	list_for_each(tmp, &bus->children) {
-		n = pci_bus_max_busnr(pci_bus_b(tmp));
+	list_for_each_entry(tmp, &bus->children, node) {
+		n = pci_bus_max_busnr(tmp);
 		if (n > max)
 			max = n;
 	}
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 1/6] PCI,acpiphp: Use list_for_each_entry() for bus traversal
@ 2014-02-13 13:13 ` Yijing Wang
  0 siblings, 0 replies; 30+ messages in thread
From: Yijing Wang @ 2014-02-13 13:13 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Russell King, David Airlie, dri-devel, Benjamin Herrenschmidt,
	linuxppc-dev, linux-pcmcia, linux-pci, Yijing Wang, Hanjun Guo

Replace list_for_each() + pci_bus_b() with the simpler
list_for_each_entry().

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
 drivers/pci/hotplug/acpiphp_glue.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index cd929ae..aee6a0a 100644
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -450,7 +450,7 @@ static void cleanup_bridge(struct acpiphp_bridge *bridge)
  */
 static unsigned char acpiphp_max_busnr(struct pci_bus *bus)
 {
-	struct list_head *tmp;
+	struct pci_bus *tmp;
 	unsigned char max, n;
 
 	/*
@@ -463,8 +463,8 @@ static unsigned char acpiphp_max_busnr(struct pci_bus *bus)
 	 */
 	max = bus->busn_res.start;
 
-	list_for_each(tmp, &bus->children) {
-		n = pci_bus_max_busnr(pci_bus_b(tmp));
+	list_for_each_entry(tmp, &bus->children, node) {
+		n = pci_bus_max_busnr(tmp);
 		if (n > max)
 			max = n;
 	}
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 2/6] PCI/arm: Use list_for_each_entry() for bus traversal
  2014-02-13 13:13 ` Yijing Wang
  (?)
@ 2014-02-13 13:13   ` Yijing Wang
  -1 siblings, 0 replies; 30+ messages in thread
From: Yijing Wang @ 2014-02-13 13:13 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Russell King, David Airlie, dri-devel, Benjamin Herrenschmidt,
	linuxppc-dev, linux-pcmcia, linux-pci, Yijing Wang, Hanjun Guo

Replace list_for_each() + pci_bus_b() with the simpler
list_for_each_entry().

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
 arch/arm/kernel/bios32.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
index 317da88..0a77858 100644
--- a/arch/arm/kernel/bios32.c
+++ b/arch/arm/kernel/bios32.c
@@ -57,13 +57,10 @@ static void pcibios_bus_report_status(struct pci_bus *bus, u_int status_mask, in
 
 void pcibios_report_status(u_int status_mask, int warn)
 {
-	struct list_head *l;
-
-	list_for_each(l, &pci_root_buses) {
-		struct pci_bus *bus = pci_bus_b(l);
+	struct pci_bus *bus;
 
+	list_for_each_entry(bus, &pci_root_buses, node)
 		pcibios_bus_report_status(bus, status_mask, warn);
-	}
 }
 
 /*
-- 
1.7.1



^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 2/6] PCI/arm: Use list_for_each_entry() for bus traversal
@ 2014-02-13 13:13   ` Yijing Wang
  0 siblings, 0 replies; 30+ messages in thread
From: Yijing Wang @ 2014-02-13 13:13 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Russell King, David Airlie, linux-pcmcia, Hanjun Guo, dri-devel,
	linux-pci, Yijing Wang, linuxppc-dev

Replace list_for_each() + pci_bus_b() with the simpler
list_for_each_entry().

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
 arch/arm/kernel/bios32.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
index 317da88..0a77858 100644
--- a/arch/arm/kernel/bios32.c
+++ b/arch/arm/kernel/bios32.c
@@ -57,13 +57,10 @@ static void pcibios_bus_report_status(struct pci_bus *bus, u_int status_mask, in
 
 void pcibios_report_status(u_int status_mask, int warn)
 {
-	struct list_head *l;
-
-	list_for_each(l, &pci_root_buses) {
-		struct pci_bus *bus = pci_bus_b(l);
+	struct pci_bus *bus;
 
+	list_for_each_entry(bus, &pci_root_buses, node)
 		pcibios_bus_report_status(bus, status_mask, warn);
-	}
 }
 
 /*
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 2/6] PCI/arm: Use list_for_each_entry() for bus traversal
@ 2014-02-13 13:13   ` Yijing Wang
  0 siblings, 0 replies; 30+ messages in thread
From: Yijing Wang @ 2014-02-13 13:13 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Russell King, David Airlie, dri-devel, Benjamin Herrenschmidt,
	linuxppc-dev, linux-pcmcia, linux-pci, Yijing Wang, Hanjun Guo

Replace list_for_each() + pci_bus_b() with the simpler
list_for_each_entry().

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
 arch/arm/kernel/bios32.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
index 317da88..0a77858 100644
--- a/arch/arm/kernel/bios32.c
+++ b/arch/arm/kernel/bios32.c
@@ -57,13 +57,10 @@ static void pcibios_bus_report_status(struct pci_bus *bus, u_int status_mask, in
 
 void pcibios_report_status(u_int status_mask, int warn)
 {
-	struct list_head *l;
-
-	list_for_each(l, &pci_root_buses) {
-		struct pci_bus *bus = pci_bus_b(l);
+	struct pci_bus *bus;
 
+	list_for_each_entry(bus, &pci_root_buses, node)
 		pcibios_bus_report_status(bus, status_mask, warn);
-	}
 }
 
 /*
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 3/6] PCI/drm: Use list_for_each_entry() for bus traversal
  2014-02-13 13:13 ` Yijing Wang
@ 2014-02-13 13:14   ` Yijing Wang
  -1 siblings, 0 replies; 30+ messages in thread
From: Yijing Wang @ 2014-02-13 13:14 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Russell King, David Airlie, dri-devel, Benjamin Herrenschmidt,
	linuxppc-dev, linux-pcmcia, linux-pci, Yijing Wang, Hanjun Guo

Replace list_for_each() + pci_bus_b() with the simpler
list_for_each_entry().

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
 drivers/gpu/drm/drm_fops.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c
index 7f2af9a..70d2987 100644
--- a/drivers/gpu/drm/drm_fops.c
+++ b/drivers/gpu/drm/drm_fops.c
@@ -319,7 +319,8 @@ static int drm_open_helper(struct inode *inode, struct file *filp,
 			pci_dev_put(pci_dev);
 		}
 		if (!dev->hose) {
-			struct pci_bus *b = pci_bus_b(pci_root_buses.next);
+			struct pci_bus *b = list_entry(pci_root_buses.next,
+				struct pci_bus, node);
 			if (b)
 				dev->hose = b->sysdata;
 		}
-- 
1.7.1



^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 3/6] PCI/drm: Use list_for_each_entry() for bus traversal
@ 2014-02-13 13:14   ` Yijing Wang
  0 siblings, 0 replies; 30+ messages in thread
From: Yijing Wang @ 2014-02-13 13:14 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Russell King, David Airlie, linux-pcmcia, Hanjun Guo, dri-devel,
	linux-pci, Yijing Wang, linuxppc-dev

Replace list_for_each() + pci_bus_b() with the simpler
list_for_each_entry().

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
 drivers/gpu/drm/drm_fops.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c
index 7f2af9a..70d2987 100644
--- a/drivers/gpu/drm/drm_fops.c
+++ b/drivers/gpu/drm/drm_fops.c
@@ -319,7 +319,8 @@ static int drm_open_helper(struct inode *inode, struct file *filp,
 			pci_dev_put(pci_dev);
 		}
 		if (!dev->hose) {
-			struct pci_bus *b = pci_bus_b(pci_root_buses.next);
+			struct pci_bus *b = list_entry(pci_root_buses.next,
+				struct pci_bus, node);
 			if (b)
 				dev->hose = b->sysdata;
 		}
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 4/6] PCI/powerpc: Use list_for_each_entry() for bus traversal
  2014-02-13 13:13 ` Yijing Wang
@ 2014-02-13 13:14   ` Yijing Wang
  -1 siblings, 0 replies; 30+ messages in thread
From: Yijing Wang @ 2014-02-13 13:14 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Russell King, David Airlie, dri-devel, Benjamin Herrenschmidt,
	linuxppc-dev, linux-pcmcia, linux-pci, Yijing Wang, Hanjun Guo

Replace list_for_each() + pci_bus_b() with the simpler
list_for_each_entry().

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
 arch/powerpc/kernel/pci_64.c               |    4 +---
 arch/powerpc/platforms/pseries/pci_dlpar.c |    6 +++---
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index a9e311f..2a47790 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -208,7 +208,6 @@ long sys_pciconfig_iobase(long which, unsigned long in_bus,
 			  unsigned long in_devfn)
 {
 	struct pci_controller* hose;
-	struct list_head *ln;
 	struct pci_bus *bus = NULL;
 	struct device_node *hose_node;
 
@@ -230,8 +229,7 @@ long sys_pciconfig_iobase(long which, unsigned long in_bus,
 	 * used on pre-domains setup. We return the first match
 	 */
 
-	for (ln = pci_root_buses.next; ln != &pci_root_buses; ln = ln->next) {
-		bus = pci_bus_b(ln);
+	list_for_each_entry(bus, &pci_root_buses, node) {
 		if (in_bus >= bus->number && in_bus <= bus->busn_res.end)
 			break;
 		bus = NULL;
diff --git a/arch/powerpc/platforms/pseries/pci_dlpar.c b/arch/powerpc/platforms/pseries/pci_dlpar.c
index efe6137..203cbf0 100644
--- a/arch/powerpc/platforms/pseries/pci_dlpar.c
+++ b/arch/powerpc/platforms/pseries/pci_dlpar.c
@@ -37,15 +37,15 @@ find_bus_among_children(struct pci_bus *bus,
                         struct device_node *dn)
 {
 	struct pci_bus *child = NULL;
-	struct list_head *tmp;
+	struct pci_bus *tmp;
 	struct device_node *busdn;
 
 	busdn = pci_bus_to_OF_node(bus);
 	if (busdn == dn)
 		return bus;
 
-	list_for_each(tmp, &bus->children) {
-		child = find_bus_among_children(pci_bus_b(tmp), dn);
+	list_for_each_entry(tmp, &bus->children, node) {
+		child = find_bus_among_children(tmp, dn);
 		if (child)
 			break;
 	};
-- 
1.7.1



^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 4/6] PCI/powerpc: Use list_for_each_entry() for bus traversal
@ 2014-02-13 13:14   ` Yijing Wang
  0 siblings, 0 replies; 30+ messages in thread
From: Yijing Wang @ 2014-02-13 13:14 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Russell King, David Airlie, linux-pcmcia, Hanjun Guo, dri-devel,
	linux-pci, Yijing Wang, linuxppc-dev

Replace list_for_each() + pci_bus_b() with the simpler
list_for_each_entry().

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
 arch/powerpc/kernel/pci_64.c               |    4 +---
 arch/powerpc/platforms/pseries/pci_dlpar.c |    6 +++---
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index a9e311f..2a47790 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -208,7 +208,6 @@ long sys_pciconfig_iobase(long which, unsigned long in_bus,
 			  unsigned long in_devfn)
 {
 	struct pci_controller* hose;
-	struct list_head *ln;
 	struct pci_bus *bus = NULL;
 	struct device_node *hose_node;
 
@@ -230,8 +229,7 @@ long sys_pciconfig_iobase(long which, unsigned long in_bus,
 	 * used on pre-domains setup. We return the first match
 	 */
 
-	for (ln = pci_root_buses.next; ln != &pci_root_buses; ln = ln->next) {
-		bus = pci_bus_b(ln);
+	list_for_each_entry(bus, &pci_root_buses, node) {
 		if (in_bus >= bus->number && in_bus <= bus->busn_res.end)
 			break;
 		bus = NULL;
diff --git a/arch/powerpc/platforms/pseries/pci_dlpar.c b/arch/powerpc/platforms/pseries/pci_dlpar.c
index efe6137..203cbf0 100644
--- a/arch/powerpc/platforms/pseries/pci_dlpar.c
+++ b/arch/powerpc/platforms/pseries/pci_dlpar.c
@@ -37,15 +37,15 @@ find_bus_among_children(struct pci_bus *bus,
                         struct device_node *dn)
 {
 	struct pci_bus *child = NULL;
-	struct list_head *tmp;
+	struct pci_bus *tmp;
 	struct device_node *busdn;
 
 	busdn = pci_bus_to_OF_node(bus);
 	if (busdn == dn)
 		return bus;
 
-	list_for_each(tmp, &bus->children) {
-		child = find_bus_among_children(pci_bus_b(tmp), dn);
+	list_for_each_entry(tmp, &bus->children, node) {
+		child = find_bus_among_children(tmp, dn);
 		if (child)
 			break;
 	};
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 5/6] PCI/pcmcia: Use list_for_each_entry() for bus traversal
  2014-02-13 13:13 ` Yijing Wang
  (?)
@ 2014-02-13 13:14   ` Yijing Wang
  -1 siblings, 0 replies; 30+ messages in thread
From: Yijing Wang @ 2014-02-13 13:14 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Russell King, David Airlie, dri-devel, Benjamin Herrenschmidt,
	linuxppc-dev, linux-pcmcia, linux-pci, Yijing Wang, Hanjun Guo

Replace list_for_each() + pci_bus_b() with the simpler
list_for_each_entry().

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
 drivers/pcmcia/yenta_socket.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c
index 8485761..d16fb12 100644
--- a/drivers/pcmcia/yenta_socket.c
+++ b/drivers/pcmcia/yenta_socket.c
@@ -1076,7 +1076,7 @@ static void yenta_config_init(struct yenta_socket *socket)
  */
 static void yenta_fixup_parent_bridge(struct pci_bus *cardbus_bridge)
 {
-	struct list_head *tmp;
+	struct pci_bus *silbling;
 	unsigned char upper_limit;
 	/*
 	 * We only check and fix the parent bridge: All systems which need
@@ -1096,8 +1096,8 @@ static void yenta_fixup_parent_bridge(struct pci_bus *cardbus_bridge)
 	upper_limit = bridge_to_fix->parent->busn_res.end;
 
 	/* check the bus ranges of all silbling bridges to prevent overlap */
-	list_for_each(tmp, &bridge_to_fix->parent->children) {
-		struct pci_bus *silbling = pci_bus_b(tmp);
+	list_for_each_entry(silbling, &bridge_to_fix->parent->children,
+			node) {
 		/*
 		 * If the silbling has a higher secondary bus number
 		 * and it's secondary is equal or smaller than our
-- 
1.7.1



^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 5/6] PCI/pcmcia: Use list_for_each_entry() for bus traversal
@ 2014-02-13 13:14   ` Yijing Wang
  0 siblings, 0 replies; 30+ messages in thread
From: Yijing Wang @ 2014-02-13 13:14 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Russell King, David Airlie, linux-pcmcia, Hanjun Guo, dri-devel,
	linux-pci, Yijing Wang, linuxppc-dev

Replace list_for_each() + pci_bus_b() with the simpler
list_for_each_entry().

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
 drivers/pcmcia/yenta_socket.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c
index 8485761..d16fb12 100644
--- a/drivers/pcmcia/yenta_socket.c
+++ b/drivers/pcmcia/yenta_socket.c
@@ -1076,7 +1076,7 @@ static void yenta_config_init(struct yenta_socket *socket)
  */
 static void yenta_fixup_parent_bridge(struct pci_bus *cardbus_bridge)
 {
-	struct list_head *tmp;
+	struct pci_bus *silbling;
 	unsigned char upper_limit;
 	/*
 	 * We only check and fix the parent bridge: All systems which need
@@ -1096,8 +1096,8 @@ static void yenta_fixup_parent_bridge(struct pci_bus *cardbus_bridge)
 	upper_limit = bridge_to_fix->parent->busn_res.end;
 
 	/* check the bus ranges of all silbling bridges to prevent overlap */
-	list_for_each(tmp, &bridge_to_fix->parent->children) {
-		struct pci_bus *silbling = pci_bus_b(tmp);
+	list_for_each_entry(silbling, &bridge_to_fix->parent->children,
+			node) {
 		/*
 		 * If the silbling has a higher secondary bus number
 		 * and it's secondary is equal or smaller than our
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 5/6] PCI/pcmcia: Use list_for_each_entry() for bus traversal
@ 2014-02-13 13:14   ` Yijing Wang
  0 siblings, 0 replies; 30+ messages in thread
From: Yijing Wang @ 2014-02-13 13:14 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Russell King, David Airlie, dri-devel, Benjamin Herrenschmidt,
	linuxppc-dev, linux-pcmcia, linux-pci, Yijing Wang, Hanjun Guo

Replace list_for_each() + pci_bus_b() with the simpler
list_for_each_entry().

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
 drivers/pcmcia/yenta_socket.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c
index 8485761..d16fb12 100644
--- a/drivers/pcmcia/yenta_socket.c
+++ b/drivers/pcmcia/yenta_socket.c
@@ -1076,7 +1076,7 @@ static void yenta_config_init(struct yenta_socket *socket)
  */
 static void yenta_fixup_parent_bridge(struct pci_bus *cardbus_bridge)
 {
-	struct list_head *tmp;
+	struct pci_bus *silbling;
 	unsigned char upper_limit;
 	/*
 	 * We only check and fix the parent bridge: All systems which need
@@ -1096,8 +1096,8 @@ static void yenta_fixup_parent_bridge(struct pci_bus *cardbus_bridge)
 	upper_limit = bridge_to_fix->parent->busn_res.end;
 
 	/* check the bus ranges of all silbling bridges to prevent overlap */
-	list_for_each(tmp, &bridge_to_fix->parent->children) {
-		struct pci_bus *silbling = pci_bus_b(tmp);
+	list_for_each_entry(silbling, &bridge_to_fix->parent->children,
+			node) {
 		/*
 		 * If the silbling has a higher secondary bus number
 		 * and it's secondary is equal or smaller than our
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 6/6] PCI: Remove pci_bus_b() and use list_entry() directly
  2014-02-13 13:13 ` Yijing Wang
  (?)
@ 2014-02-13 13:14   ` Yijing Wang
  -1 siblings, 0 replies; 30+ messages in thread
From: Yijing Wang @ 2014-02-13 13:14 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Russell King, David Airlie, dri-devel, Benjamin Herrenschmidt,
	linuxppc-dev, linux-pcmcia, linux-pci, Yijing Wang, Hanjun Guo

Replace pci_bus_b() with list_entry(), so we can remove
pci_bus_b().

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
 drivers/pci/pci.c    |    6 +++---
 drivers/pci/search.c |   10 +++++-----
 include/linux/pci.h  |    1 -
 3 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 1febe90..6f5ed88 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -108,12 +108,12 @@ static bool pcie_ari_disabled;
  */
 unsigned char pci_bus_max_busnr(struct pci_bus* bus)
 {
-	struct list_head *tmp;
+	struct pci_bus *tmp;
 	unsigned char max, n;
 
 	max = bus->busn_res.end;
-	list_for_each(tmp, &bus->children) {
-		n = pci_bus_max_busnr(pci_bus_b(tmp));
+	list_for_each_entry(tmp, &bus->children, node) {
+		n = pci_bus_max_busnr(tmp);
 		if(n > max)
 			max = n;
 	}
diff --git a/drivers/pci/search.c b/drivers/pci/search.c
index 3ff2ac7..4a1b972 100644
--- a/drivers/pci/search.c
+++ b/drivers/pci/search.c
@@ -54,14 +54,14 @@ pci_find_upstream_pcie_bridge(struct pci_dev *pdev)
 
 static struct pci_bus *pci_do_find_bus(struct pci_bus *bus, unsigned char busnr)
 {
-	struct pci_bus* child;
-	struct list_head *tmp;
+	struct pci_bus *child;
+	struct pci_bus *tmp;
 
 	if(bus->number == busnr)
 		return bus;
 
-	list_for_each(tmp, &bus->children) {
-		child = pci_do_find_bus(pci_bus_b(tmp), busnr);
+	list_for_each_entry(tmp, &bus->children, node) {
+		child = pci_do_find_bus(tmp, busnr);
 		if(child)
 			return child;
 	}
@@ -111,7 +111,7 @@ pci_find_next_bus(const struct pci_bus *from)
 	down_read(&pci_bus_sem);
 	n = from ? from->node.next : pci_root_buses.next;
 	if (n != &pci_root_buses)
-		b = pci_bus_b(n);
+		b = list_entry(n, struct pci_bus, node);
 	up_read(&pci_bus_sem);
 	return b;
 }
diff --git a/include/linux/pci.h b/include/linux/pci.h
index fb57c89..e1b5752 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -461,7 +461,6 @@ struct pci_bus {
 	unsigned int		is_added:1;
 };
 
-#define pci_bus_b(n)	list_entry(n, struct pci_bus, node)
 #define to_pci_bus(n)	container_of(n, struct pci_bus, dev)
 
 /*
-- 
1.7.1



^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 6/6] PCI: Remove pci_bus_b() and use list_entry() directly
@ 2014-02-13 13:14   ` Yijing Wang
  0 siblings, 0 replies; 30+ messages in thread
From: Yijing Wang @ 2014-02-13 13:14 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Russell King, David Airlie, linux-pcmcia, Hanjun Guo, dri-devel,
	linux-pci, Yijing Wang, linuxppc-dev

Replace pci_bus_b() with list_entry(), so we can remove
pci_bus_b().

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
 drivers/pci/pci.c    |    6 +++---
 drivers/pci/search.c |   10 +++++-----
 include/linux/pci.h  |    1 -
 3 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 1febe90..6f5ed88 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -108,12 +108,12 @@ static bool pcie_ari_disabled;
  */
 unsigned char pci_bus_max_busnr(struct pci_bus* bus)
 {
-	struct list_head *tmp;
+	struct pci_bus *tmp;
 	unsigned char max, n;
 
 	max = bus->busn_res.end;
-	list_for_each(tmp, &bus->children) {
-		n = pci_bus_max_busnr(pci_bus_b(tmp));
+	list_for_each_entry(tmp, &bus->children, node) {
+		n = pci_bus_max_busnr(tmp);
 		if(n > max)
 			max = n;
 	}
diff --git a/drivers/pci/search.c b/drivers/pci/search.c
index 3ff2ac7..4a1b972 100644
--- a/drivers/pci/search.c
+++ b/drivers/pci/search.c
@@ -54,14 +54,14 @@ pci_find_upstream_pcie_bridge(struct pci_dev *pdev)
 
 static struct pci_bus *pci_do_find_bus(struct pci_bus *bus, unsigned char busnr)
 {
-	struct pci_bus* child;
-	struct list_head *tmp;
+	struct pci_bus *child;
+	struct pci_bus *tmp;
 
 	if(bus->number == busnr)
 		return bus;
 
-	list_for_each(tmp, &bus->children) {
-		child = pci_do_find_bus(pci_bus_b(tmp), busnr);
+	list_for_each_entry(tmp, &bus->children, node) {
+		child = pci_do_find_bus(tmp, busnr);
 		if(child)
 			return child;
 	}
@@ -111,7 +111,7 @@ pci_find_next_bus(const struct pci_bus *from)
 	down_read(&pci_bus_sem);
 	n = from ? from->node.next : pci_root_buses.next;
 	if (n != &pci_root_buses)
-		b = pci_bus_b(n);
+		b = list_entry(n, struct pci_bus, node);
 	up_read(&pci_bus_sem);
 	return b;
 }
diff --git a/include/linux/pci.h b/include/linux/pci.h
index fb57c89..e1b5752 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -461,7 +461,6 @@ struct pci_bus {
 	unsigned int		is_added:1;
 };
 
-#define pci_bus_b(n)	list_entry(n, struct pci_bus, node)
 #define to_pci_bus(n)	container_of(n, struct pci_bus, dev)
 
 /*
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 6/6] PCI: Remove pci_bus_b() and use list_entry() directly
@ 2014-02-13 13:14   ` Yijing Wang
  0 siblings, 0 replies; 30+ messages in thread
From: Yijing Wang @ 2014-02-13 13:14 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Russell King, David Airlie, dri-devel, Benjamin Herrenschmidt,
	linuxppc-dev, linux-pcmcia, linux-pci, Yijing Wang, Hanjun Guo

Replace pci_bus_b() with list_entry(), so we can remove
pci_bus_b().

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
 drivers/pci/pci.c    |    6 +++---
 drivers/pci/search.c |   10 +++++-----
 include/linux/pci.h  |    1 -
 3 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 1febe90..6f5ed88 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -108,12 +108,12 @@ static bool pcie_ari_disabled;
  */
 unsigned char pci_bus_max_busnr(struct pci_bus* bus)
 {
-	struct list_head *tmp;
+	struct pci_bus *tmp;
 	unsigned char max, n;
 
 	max = bus->busn_res.end;
-	list_for_each(tmp, &bus->children) {
-		n = pci_bus_max_busnr(pci_bus_b(tmp));
+	list_for_each_entry(tmp, &bus->children, node) {
+		n = pci_bus_max_busnr(tmp);
 		if(n > max)
 			max = n;
 	}
diff --git a/drivers/pci/search.c b/drivers/pci/search.c
index 3ff2ac7..4a1b972 100644
--- a/drivers/pci/search.c
+++ b/drivers/pci/search.c
@@ -54,14 +54,14 @@ pci_find_upstream_pcie_bridge(struct pci_dev *pdev)
 
 static struct pci_bus *pci_do_find_bus(struct pci_bus *bus, unsigned char busnr)
 {
-	struct pci_bus* child;
-	struct list_head *tmp;
+	struct pci_bus *child;
+	struct pci_bus *tmp;
 
 	if(bus->number == busnr)
 		return bus;
 
-	list_for_each(tmp, &bus->children) {
-		child = pci_do_find_bus(pci_bus_b(tmp), busnr);
+	list_for_each_entry(tmp, &bus->children, node) {
+		child = pci_do_find_bus(tmp, busnr);
 		if(child)
 			return child;
 	}
@@ -111,7 +111,7 @@ pci_find_next_bus(const struct pci_bus *from)
 	down_read(&pci_bus_sem);
 	n = from ? from->node.next : pci_root_buses.next;
 	if (n != &pci_root_buses)
-		b = pci_bus_b(n);
+		b = list_entry(n, struct pci_bus, node);
 	up_read(&pci_bus_sem);
 	return b;
 }
diff --git a/include/linux/pci.h b/include/linux/pci.h
index fb57c89..e1b5752 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -461,7 +461,6 @@ struct pci_bus {
 	unsigned int		is_added:1;
 };
 
-#define pci_bus_b(n)	list_entry(n, struct pci_bus, node)
 #define to_pci_bus(n)	container_of(n, struct pci_bus, dev)
 
 /*
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* Re: [PATCH 2/6] PCI/arm: Use list_for_each_entry() for bus traversal
  2014-02-13 13:13   ` Yijing Wang
@ 2014-02-13 14:46     ` Russell King - ARM Linux
  -1 siblings, 0 replies; 30+ messages in thread
From: Russell King - ARM Linux @ 2014-02-13 14:46 UTC (permalink / raw)
  To: Yijing Wang
  Cc: Bjorn Helgaas, David Airlie, dri-devel, Benjamin Herrenschmidt,
	linuxppc-dev, linux-pcmcia, linux-pci, Hanjun Guo

On Thu, Feb 13, 2014 at 09:13:59PM +0800, Yijing Wang wrote:
> Replace list_for_each() + pci_bus_b() with the simpler
> list_for_each_entry().
> 
> Signed-off-by: Yijing Wang <wangyijing@huawei.com>

Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>

-- 
FTTC broadband for 0.8mile line: 5.8Mbps down 500kbps up.  Estimation
in database were 13.1 to 19Mbit for a good line, about 7.5+ for a bad.
Estimate before purchase was "up to 13.2Mbit".

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 2/6] PCI/arm: Use list_for_each_entry() for bus traversal
@ 2014-02-13 14:46     ` Russell King - ARM Linux
  0 siblings, 0 replies; 30+ messages in thread
From: Russell King - ARM Linux @ 2014-02-13 14:46 UTC (permalink / raw)
  To: Yijing Wang
  Cc: David Airlie, linux-pcmcia, Hanjun Guo, dri-devel, linux-pci,
	Bjorn Helgaas, linuxppc-dev

On Thu, Feb 13, 2014 at 09:13:59PM +0800, Yijing Wang wrote:
> Replace list_for_each() + pci_bus_b() with the simpler
> list_for_each_entry().
> 
> Signed-off-by: Yijing Wang <wangyijing@huawei.com>

Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>

-- 
FTTC broadband for 0.8mile line: 5.8Mbps down 500kbps up.  Estimation
in database were 13.1 to 19Mbit for a good line, about 7.5+ for a bad.
Estimate before purchase was "up to 13.2Mbit".

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 1/6] PCI,acpiphp: Use list_for_each_entry() for bus traversal
  2014-02-13 13:13 ` Yijing Wang
@ 2014-02-13 23:54   ` Rafael J. Wysocki
  -1 siblings, 0 replies; 30+ messages in thread
From: Rafael J. Wysocki @ 2014-02-13 23:54 UTC (permalink / raw)
  To: Yijing Wang
  Cc: Bjorn Helgaas, Russell King, David Airlie, dri-devel,
	Benjamin Herrenschmidt, linuxppc-dev, linux-pcmcia, linux-pci,
	Hanjun Guo

On Thursday, February 13, 2014 09:13:58 PM Yijing Wang wrote:
> Replace list_for_each() + pci_bus_b() with the simpler
> list_for_each_entry().
> 
> Signed-off-by: Yijing Wang <wangyijing@huawei.com>

Looks reasonable to me.

Does it conflict with anything currently in linux-next (the linux-next branch
of linux-pm.git in particular)?

> ---
>  drivers/pci/hotplug/acpiphp_glue.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
> index cd929ae..aee6a0a 100644
> --- a/drivers/pci/hotplug/acpiphp_glue.c
> +++ b/drivers/pci/hotplug/acpiphp_glue.c
> @@ -450,7 +450,7 @@ static void cleanup_bridge(struct acpiphp_bridge *bridge)
>   */
>  static unsigned char acpiphp_max_busnr(struct pci_bus *bus)
>  {
> -	struct list_head *tmp;
> +	struct pci_bus *tmp;
>  	unsigned char max, n;
>  
>  	/*
> @@ -463,8 +463,8 @@ static unsigned char acpiphp_max_busnr(struct pci_bus *bus)
>  	 */
>  	max = bus->busn_res.start;
>  
> -	list_for_each(tmp, &bus->children) {
> -		n = pci_bus_max_busnr(pci_bus_b(tmp));
> +	list_for_each_entry(tmp, &bus->children, node) {
> +		n = pci_bus_max_busnr(tmp);
>  		if (n > max)
>  			max = n;
>  	}
> 

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 1/6] PCI, acpiphp: Use list_for_each_entry() for bus traversal
@ 2014-02-13 23:54   ` Rafael J. Wysocki
  0 siblings, 0 replies; 30+ messages in thread
From: Rafael J. Wysocki @ 2014-02-13 23:54 UTC (permalink / raw)
  To: Yijing Wang
  Cc: Russell King, David Airlie, linux-pcmcia, Hanjun Guo, dri-devel,
	linux-pci, Bjorn Helgaas, linuxppc-dev

On Thursday, February 13, 2014 09:13:58 PM Yijing Wang wrote:
> Replace list_for_each() + pci_bus_b() with the simpler
> list_for_each_entry().
> 
> Signed-off-by: Yijing Wang <wangyijing@huawei.com>

Looks reasonable to me.

Does it conflict with anything currently in linux-next (the linux-next branch
of linux-pm.git in particular)?

> ---
>  drivers/pci/hotplug/acpiphp_glue.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
> index cd929ae..aee6a0a 100644
> --- a/drivers/pci/hotplug/acpiphp_glue.c
> +++ b/drivers/pci/hotplug/acpiphp_glue.c
> @@ -450,7 +450,7 @@ static void cleanup_bridge(struct acpiphp_bridge *bridge)
>   */
>  static unsigned char acpiphp_max_busnr(struct pci_bus *bus)
>  {
> -	struct list_head *tmp;
> +	struct pci_bus *tmp;
>  	unsigned char max, n;
>  
>  	/*
> @@ -463,8 +463,8 @@ static unsigned char acpiphp_max_busnr(struct pci_bus *bus)
>  	 */
>  	max = bus->busn_res.start;
>  
> -	list_for_each(tmp, &bus->children) {
> -		n = pci_bus_max_busnr(pci_bus_b(tmp));
> +	list_for_each_entry(tmp, &bus->children, node) {
> +		n = pci_bus_max_busnr(tmp);
>  		if (n > max)
>  			max = n;
>  	}
> 

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 1/6] PCI,acpiphp: Use list_for_each_entry() for bus traversal
  2014-02-13 23:54   ` [PATCH 1/6] PCI, acpiphp: " Rafael J. Wysocki
@ 2014-02-14  2:19     ` Yijing Wang
  -1 siblings, 0 replies; 30+ messages in thread
From: Yijing Wang @ 2014-02-14  2:19 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Bjorn Helgaas, Russell King, David Airlie, dri-devel,
	Benjamin Herrenschmidt, linuxppc-dev, linux-pcmcia, linux-pci,
	Hanjun Guo

On 2014/2/14 7:54, Rafael J. Wysocki wrote:
> On Thursday, February 13, 2014 09:13:58 PM Yijing Wang wrote:
>> Replace list_for_each() + pci_bus_b() with the simpler
>> list_for_each_entry().
>>
>> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
> 
> Looks reasonable to me.
> 
> Does it conflict with anything currently in linux-next (the linux-next branch
> of linux-pm.git in particular)?

Hi Rafael,
   I applied this to your linux-next branch successfully . No conflicts found.

Thanks!
Yijing.

> 
>> ---
>>  drivers/pci/hotplug/acpiphp_glue.c |    6 +++---
>>  1 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
>> index cd929ae..aee6a0a 100644
>> --- a/drivers/pci/hotplug/acpiphp_glue.c
>> +++ b/drivers/pci/hotplug/acpiphp_glue.c
>> @@ -450,7 +450,7 @@ static void cleanup_bridge(struct acpiphp_bridge *bridge)
>>   */
>>  static unsigned char acpiphp_max_busnr(struct pci_bus *bus)
>>  {
>> -	struct list_head *tmp;
>> +	struct pci_bus *tmp;
>>  	unsigned char max, n;
>>  
>>  	/*
>> @@ -463,8 +463,8 @@ static unsigned char acpiphp_max_busnr(struct pci_bus *bus)
>>  	 */
>>  	max = bus->busn_res.start;
>>  
>> -	list_for_each(tmp, &bus->children) {
>> -		n = pci_bus_max_busnr(pci_bus_b(tmp));
>> +	list_for_each_entry(tmp, &bus->children, node) {
>> +		n = pci_bus_max_busnr(tmp);
>>  		if (n > max)
>>  			max = n;
>>  	}
>>
> 


-- 
Thanks!
Yijing


^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 1/6] PCI, acpiphp: Use list_for_each_entry() for bus traversal
@ 2014-02-14  2:19     ` Yijing Wang
  0 siblings, 0 replies; 30+ messages in thread
From: Yijing Wang @ 2014-02-14  2:19 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Russell King, David Airlie, linux-pcmcia, Hanjun Guo, dri-devel,
	linux-pci, Bjorn Helgaas, linuxppc-dev

On 2014/2/14 7:54, Rafael J. Wysocki wrote:
> On Thursday, February 13, 2014 09:13:58 PM Yijing Wang wrote:
>> Replace list_for_each() + pci_bus_b() with the simpler
>> list_for_each_entry().
>>
>> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
> 
> Looks reasonable to me.
> 
> Does it conflict with anything currently in linux-next (the linux-next branch
> of linux-pm.git in particular)?

Hi Rafael,
   I applied this to your linux-next branch successfully . No conflicts found.

Thanks!
Yijing.

> 
>> ---
>>  drivers/pci/hotplug/acpiphp_glue.c |    6 +++---
>>  1 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
>> index cd929ae..aee6a0a 100644
>> --- a/drivers/pci/hotplug/acpiphp_glue.c
>> +++ b/drivers/pci/hotplug/acpiphp_glue.c
>> @@ -450,7 +450,7 @@ static void cleanup_bridge(struct acpiphp_bridge *bridge)
>>   */
>>  static unsigned char acpiphp_max_busnr(struct pci_bus *bus)
>>  {
>> -	struct list_head *tmp;
>> +	struct pci_bus *tmp;
>>  	unsigned char max, n;
>>  
>>  	/*
>> @@ -463,8 +463,8 @@ static unsigned char acpiphp_max_busnr(struct pci_bus *bus)
>>  	 */
>>  	max = bus->busn_res.start;
>>  
>> -	list_for_each(tmp, &bus->children) {
>> -		n = pci_bus_max_busnr(pci_bus_b(tmp));
>> +	list_for_each_entry(tmp, &bus->children, node) {
>> +		n = pci_bus_max_busnr(tmp);
>>  		if (n > max)
>>  			max = n;
>>  	}
>>
> 


-- 
Thanks!
Yijing

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 1/6] PCI,acpiphp: Use list_for_each_entry() for bus traversal
  2014-02-14  2:19     ` [PATCH 1/6] PCI, acpiphp: " Yijing Wang
@ 2014-02-14 13:39       ` Rafael J. Wysocki
  -1 siblings, 0 replies; 30+ messages in thread
From: Rafael J. Wysocki @ 2014-02-14 13:39 UTC (permalink / raw)
  To: Yijing Wang
  Cc: Bjorn Helgaas, Russell King, David Airlie, dri-devel,
	Benjamin Herrenschmidt, linuxppc-dev, linux-pcmcia, linux-pci,
	Hanjun Guo

On Friday, February 14, 2014 10:19:41 AM Yijing Wang wrote:
> On 2014/2/14 7:54, Rafael J. Wysocki wrote:
> > On Thursday, February 13, 2014 09:13:58 PM Yijing Wang wrote:
> >> Replace list_for_each() + pci_bus_b() with the simpler
> >> list_for_each_entry().
> >>
> >> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
> > 
> > Looks reasonable to me.
> > 
> > Does it conflict with anything currently in linux-next (the linux-next branch
> > of linux-pm.git in particular)?
> 
> Hi Rafael,
>    I applied this to your linux-next branch successfully . No conflicts found.

Good. :-)

Please feel free to add my ACK to it.

Rafael


> >> ---
> >>  drivers/pci/hotplug/acpiphp_glue.c |    6 +++---
> >>  1 files changed, 3 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
> >> index cd929ae..aee6a0a 100644
> >> --- a/drivers/pci/hotplug/acpiphp_glue.c
> >> +++ b/drivers/pci/hotplug/acpiphp_glue.c
> >> @@ -450,7 +450,7 @@ static void cleanup_bridge(struct acpiphp_bridge *bridge)
> >>   */
> >>  static unsigned char acpiphp_max_busnr(struct pci_bus *bus)
> >>  {
> >> -	struct list_head *tmp;
> >> +	struct pci_bus *tmp;
> >>  	unsigned char max, n;
> >>  
> >>  	/*
> >> @@ -463,8 +463,8 @@ static unsigned char acpiphp_max_busnr(struct pci_bus *bus)
> >>  	 */
> >>  	max = bus->busn_res.start;
> >>  
> >> -	list_for_each(tmp, &bus->children) {
> >> -		n = pci_bus_max_busnr(pci_bus_b(tmp));
> >> +	list_for_each_entry(tmp, &bus->children, node) {
> >> +		n = pci_bus_max_busnr(tmp);
> >>  		if (n > max)
> >>  			max = n;
> >>  	}
> >>
> > 
> 
> 
> 

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 1/6] PCI, acpiphp: Use list_for_each_entry() for bus traversal
@ 2014-02-14 13:39       ` Rafael J. Wysocki
  0 siblings, 0 replies; 30+ messages in thread
From: Rafael J. Wysocki @ 2014-02-14 13:39 UTC (permalink / raw)
  To: Yijing Wang
  Cc: Russell King, David Airlie, linux-pcmcia, Hanjun Guo, dri-devel,
	linux-pci, Bjorn Helgaas, linuxppc-dev

On Friday, February 14, 2014 10:19:41 AM Yijing Wang wrote:
> On 2014/2/14 7:54, Rafael J. Wysocki wrote:
> > On Thursday, February 13, 2014 09:13:58 PM Yijing Wang wrote:
> >> Replace list_for_each() + pci_bus_b() with the simpler
> >> list_for_each_entry().
> >>
> >> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
> > 
> > Looks reasonable to me.
> > 
> > Does it conflict with anything currently in linux-next (the linux-next branch
> > of linux-pm.git in particular)?
> 
> Hi Rafael,
>    I applied this to your linux-next branch successfully . No conflicts found.

Good. :-)

Please feel free to add my ACK to it.

Rafael


> >> ---
> >>  drivers/pci/hotplug/acpiphp_glue.c |    6 +++---
> >>  1 files changed, 3 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
> >> index cd929ae..aee6a0a 100644
> >> --- a/drivers/pci/hotplug/acpiphp_glue.c
> >> +++ b/drivers/pci/hotplug/acpiphp_glue.c
> >> @@ -450,7 +450,7 @@ static void cleanup_bridge(struct acpiphp_bridge *bridge)
> >>   */
> >>  static unsigned char acpiphp_max_busnr(struct pci_bus *bus)
> >>  {
> >> -	struct list_head *tmp;
> >> +	struct pci_bus *tmp;
> >>  	unsigned char max, n;
> >>  
> >>  	/*
> >> @@ -463,8 +463,8 @@ static unsigned char acpiphp_max_busnr(struct pci_bus *bus)
> >>  	 */
> >>  	max = bus->busn_res.start;
> >>  
> >> -	list_for_each(tmp, &bus->children) {
> >> -		n = pci_bus_max_busnr(pci_bus_b(tmp));
> >> +	list_for_each_entry(tmp, &bus->children, node) {
> >> +		n = pci_bus_max_busnr(tmp);
> >>  		if (n > max)
> >>  			max = n;
> >>  	}
> >>
> > 
> 
> 
> 

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 1/6] PCI,acpiphp: Use list_for_each_entry() for bus traversal
  2014-02-13 13:13 ` Yijing Wang
@ 2014-02-14 18:23   ` Bjorn Helgaas
  -1 siblings, 0 replies; 30+ messages in thread
From: Bjorn Helgaas @ 2014-02-14 18:23 UTC (permalink / raw)
  To: Yijing Wang
  Cc: Russell King, David Airlie, dri-devel, Benjamin Herrenschmidt,
	linuxppc-dev, linux-pcmcia, linux-pci, Hanjun Guo

On Thu, Feb 13, 2014 at 09:13:58PM +0800, Yijing Wang wrote:
> Replace list_for_each() + pci_bus_b() with the simpler
> list_for_each_entry().
> 
> Signed-off-by: Yijing Wang <wangyijing@huawei.com>

I applied all six of these (please include a 0/6 cover letter in the
future; that's a nice place to note that I applied things) to
pci/list-for-each-entry for v3.15, thanks!

> ---
>  drivers/pci/hotplug/acpiphp_glue.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
> index cd929ae..aee6a0a 100644
> --- a/drivers/pci/hotplug/acpiphp_glue.c
> +++ b/drivers/pci/hotplug/acpiphp_glue.c
> @@ -450,7 +450,7 @@ static void cleanup_bridge(struct acpiphp_bridge *bridge)
>   */
>  static unsigned char acpiphp_max_busnr(struct pci_bus *bus)
>  {
> -	struct list_head *tmp;
> +	struct pci_bus *tmp;
>  	unsigned char max, n;
>  
>  	/*
> @@ -463,8 +463,8 @@ static unsigned char acpiphp_max_busnr(struct pci_bus *bus)
>  	 */
>  	max = bus->busn_res.start;
>  
> -	list_for_each(tmp, &bus->children) {
> -		n = pci_bus_max_busnr(pci_bus_b(tmp));
> +	list_for_each_entry(tmp, &bus->children, node) {
> +		n = pci_bus_max_busnr(tmp);
>  		if (n > max)
>  			max = n;
>  	}
> -- 
> 1.7.1
> 
> 

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 1/6] PCI,acpiphp: Use list_for_each_entry() for bus traversal
@ 2014-02-14 18:23   ` Bjorn Helgaas
  0 siblings, 0 replies; 30+ messages in thread
From: Bjorn Helgaas @ 2014-02-14 18:23 UTC (permalink / raw)
  To: Yijing Wang
  Cc: Russell King, David Airlie, linux-pcmcia, Hanjun Guo, dri-devel,
	linux-pci, linuxppc-dev

On Thu, Feb 13, 2014 at 09:13:58PM +0800, Yijing Wang wrote:
> Replace list_for_each() + pci_bus_b() with the simpler
> list_for_each_entry().
> 
> Signed-off-by: Yijing Wang <wangyijing@huawei.com>

I applied all six of these (please include a 0/6 cover letter in the
future; that's a nice place to note that I applied things) to
pci/list-for-each-entry for v3.15, thanks!

> ---
>  drivers/pci/hotplug/acpiphp_glue.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
> index cd929ae..aee6a0a 100644
> --- a/drivers/pci/hotplug/acpiphp_glue.c
> +++ b/drivers/pci/hotplug/acpiphp_glue.c
> @@ -450,7 +450,7 @@ static void cleanup_bridge(struct acpiphp_bridge *bridge)
>   */
>  static unsigned char acpiphp_max_busnr(struct pci_bus *bus)
>  {
> -	struct list_head *tmp;
> +	struct pci_bus *tmp;
>  	unsigned char max, n;
>  
>  	/*
> @@ -463,8 +463,8 @@ static unsigned char acpiphp_max_busnr(struct pci_bus *bus)
>  	 */
>  	max = bus->busn_res.start;
>  
> -	list_for_each(tmp, &bus->children) {
> -		n = pci_bus_max_busnr(pci_bus_b(tmp));
> +	list_for_each_entry(tmp, &bus->children, node) {
> +		n = pci_bus_max_busnr(tmp);
>  		if (n > max)
>  			max = n;
>  	}
> -- 
> 1.7.1
> 
> 

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 1/6] PCI,acpiphp: Use list_for_each_entry() for bus traversal
  2014-02-14 13:39       ` [PATCH 1/6] PCI, acpiphp: " Rafael J. Wysocki
@ 2014-02-15  0:49         ` Yijing Wang
  -1 siblings, 0 replies; 30+ messages in thread
From: Yijing Wang @ 2014-02-15  0:49 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Bjorn Helgaas, Russell King, David Airlie, dri-devel,
	Benjamin Herrenschmidt, linuxppc-dev, linux-pcmcia, linux-pci,
	Hanjun Guo

>>> Does it conflict with anything currently in linux-next (the linux-next branch
>>> of linux-pm.git in particular)?
>>
>> Hi Rafael,
>>    I applied this to your linux-next branch successfully . No conflicts found.
> 
> Good. :-)
> 
> Please feel free to add my ACK to it.

Thanks very much!




^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 1/6] PCI, acpiphp: Use list_for_each_entry() for bus traversal
@ 2014-02-15  0:49         ` Yijing Wang
  0 siblings, 0 replies; 30+ messages in thread
From: Yijing Wang @ 2014-02-15  0:49 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Russell King, David Airlie, linux-pcmcia, Hanjun Guo, dri-devel,
	linux-pci, Bjorn Helgaas, linuxppc-dev

>>> Does it conflict with anything currently in linux-next (the linux-next branch
>>> of linux-pm.git in particular)?
>>
>> Hi Rafael,
>>    I applied this to your linux-next branch successfully . No conflicts found.
> 
> Good. :-)
> 
> Please feel free to add my ACK to it.

Thanks very much!

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 1/6] PCI,acpiphp: Use list_for_each_entry() for bus traversal
  2014-02-14 18:23   ` Bjorn Helgaas
@ 2014-02-15  0:52     ` Yijing Wang
  -1 siblings, 0 replies; 30+ messages in thread
From: Yijing Wang @ 2014-02-15  0:52 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Russell King, David Airlie, dri-devel, Benjamin Herrenschmidt,
	linuxppc-dev, linux-pcmcia, linux-pci, Hanjun Guo

On 2014/2/15 2:23, Bjorn Helgaas wrote:
> On Thu, Feb 13, 2014 at 09:13:58PM +0800, Yijing Wang wrote:
>> Replace list_for_each() + pci_bus_b() with the simpler
>> list_for_each_entry().
>>
>> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
> 
> I applied all six of these (please include a 0/6 cover letter in the
> future; that's a nice place to note that I applied things) to
> pci/list-for-each-entry for v3.15, thanks!

Thanks, I will add cover letter in the next time, sorry.

> 
>> ---
>>  drivers/pci/hotplug/acpiphp_glue.c |    6 +++---
>>  1 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
>> index cd929ae..aee6a0a 100644
>> --- a/drivers/pci/hotplug/acpiphp_glue.c
>> +++ b/drivers/pci/hotplug/acpiphp_glue.c
>> @@ -450,7 +450,7 @@ static void cleanup_bridge(struct acpiphp_bridge *bridge)
>>   */
>>  static unsigned char acpiphp_max_busnr(struct pci_bus *bus)
>>  {
>> -	struct list_head *tmp;
>> +	struct pci_bus *tmp;
>>  	unsigned char max, n;
>>  
>>  	/*
>> @@ -463,8 +463,8 @@ static unsigned char acpiphp_max_busnr(struct pci_bus *bus)
>>  	 */
>>  	max = bus->busn_res.start;
>>  
>> -	list_for_each(tmp, &bus->children) {
>> -		n = pci_bus_max_busnr(pci_bus_b(tmp));
>> +	list_for_each_entry(tmp, &bus->children, node) {
>> +		n = pci_bus_max_busnr(tmp);
>>  		if (n > max)
>>  			max = n;
>>  	}
>> -- 
>> 1.7.1
>>
>>
> 
> 


-- 
Thanks!
Yijing


^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 1/6] PCI, acpiphp: Use list_for_each_entry() for bus traversal
@ 2014-02-15  0:52     ` Yijing Wang
  0 siblings, 0 replies; 30+ messages in thread
From: Yijing Wang @ 2014-02-15  0:52 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Russell King, David Airlie, linux-pcmcia, Hanjun Guo, dri-devel,
	linux-pci, linuxppc-dev

On 2014/2/15 2:23, Bjorn Helgaas wrote:
> On Thu, Feb 13, 2014 at 09:13:58PM +0800, Yijing Wang wrote:
>> Replace list_for_each() + pci_bus_b() with the simpler
>> list_for_each_entry().
>>
>> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
> 
> I applied all six of these (please include a 0/6 cover letter in the
> future; that's a nice place to note that I applied things) to
> pci/list-for-each-entry for v3.15, thanks!

Thanks, I will add cover letter in the next time, sorry.

> 
>> ---
>>  drivers/pci/hotplug/acpiphp_glue.c |    6 +++---
>>  1 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
>> index cd929ae..aee6a0a 100644
>> --- a/drivers/pci/hotplug/acpiphp_glue.c
>> +++ b/drivers/pci/hotplug/acpiphp_glue.c
>> @@ -450,7 +450,7 @@ static void cleanup_bridge(struct acpiphp_bridge *bridge)
>>   */
>>  static unsigned char acpiphp_max_busnr(struct pci_bus *bus)
>>  {
>> -	struct list_head *tmp;
>> +	struct pci_bus *tmp;
>>  	unsigned char max, n;
>>  
>>  	/*
>> @@ -463,8 +463,8 @@ static unsigned char acpiphp_max_busnr(struct pci_bus *bus)
>>  	 */
>>  	max = bus->busn_res.start;
>>  
>> -	list_for_each(tmp, &bus->children) {
>> -		n = pci_bus_max_busnr(pci_bus_b(tmp));
>> +	list_for_each_entry(tmp, &bus->children, node) {
>> +		n = pci_bus_max_busnr(tmp);
>>  		if (n > max)
>>  			max = n;
>>  	}
>> -- 
>> 1.7.1
>>
>>
> 
> 


-- 
Thanks!
Yijing

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2014-02-15  0:57 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-13 13:13 [PATCH 1/6] PCI,acpiphp: Use list_for_each_entry() for bus traversal Yijing Wang
2014-02-13 13:13 ` Yijing Wang
2014-02-13 13:13 ` Yijing Wang
2014-02-13 13:13 ` [PATCH 2/6] PCI/arm: " Yijing Wang
2014-02-13 13:13   ` Yijing Wang
2014-02-13 13:13   ` Yijing Wang
2014-02-13 14:46   ` Russell King - ARM Linux
2014-02-13 14:46     ` Russell King - ARM Linux
2014-02-13 13:14 ` [PATCH 3/6] PCI/drm: " Yijing Wang
2014-02-13 13:14   ` Yijing Wang
2014-02-13 13:14 ` [PATCH 4/6] PCI/powerpc: " Yijing Wang
2014-02-13 13:14   ` Yijing Wang
2014-02-13 13:14 ` [PATCH 5/6] PCI/pcmcia: " Yijing Wang
2014-02-13 13:14   ` Yijing Wang
2014-02-13 13:14   ` Yijing Wang
2014-02-13 13:14 ` [PATCH 6/6] PCI: Remove pci_bus_b() and use list_entry() directly Yijing Wang
2014-02-13 13:14   ` Yijing Wang
2014-02-13 13:14   ` Yijing Wang
2014-02-13 23:54 ` [PATCH 1/6] PCI,acpiphp: Use list_for_each_entry() for bus traversal Rafael J. Wysocki
2014-02-13 23:54   ` [PATCH 1/6] PCI, acpiphp: " Rafael J. Wysocki
2014-02-14  2:19   ` [PATCH 1/6] PCI,acpiphp: " Yijing Wang
2014-02-14  2:19     ` [PATCH 1/6] PCI, acpiphp: " Yijing Wang
2014-02-14 13:39     ` [PATCH 1/6] PCI,acpiphp: " Rafael J. Wysocki
2014-02-14 13:39       ` [PATCH 1/6] PCI, acpiphp: " Rafael J. Wysocki
2014-02-15  0:49       ` [PATCH 1/6] PCI,acpiphp: " Yijing Wang
2014-02-15  0:49         ` [PATCH 1/6] PCI, acpiphp: " Yijing Wang
2014-02-14 18:23 ` [PATCH 1/6] PCI,acpiphp: " Bjorn Helgaas
2014-02-14 18:23   ` Bjorn Helgaas
2014-02-15  0:52   ` Yijing Wang
2014-02-15  0:52     ` [PATCH 1/6] PCI, acpiphp: " Yijing Wang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.