[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20061028183943.GA9973@localhost>
Date: Sun, 29 Oct 2006 03:39:43 +0900
From: Akinobu Mita <akinobu.mita@...il.com>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...e.de>,
Kristen Carlson Accardi <kristen.c.accardi@...el.com>
Subject: [PATCH] acpiphp: fix use of list_for_each macro
This patch fixes invalid usage of list_for_each()
list_for_each (node, &bridge_list) {
bridge = (struct acpiphp_bridge *)node;
...
}
This code works while the member of list node is located at the
head of struct acpiphp_bridge.
Cc: Greg Kroah-Hartman <gregkh@...e.de>
Cc: Kristen Carlson Accardi <kristen.c.accardi@...el.com>
Signed-off-by: Akinobu Mita <akinobu.mita@...il.com>
drivers/pci/hotplug/acpiphp_glue.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
Index: work-fault-inject/drivers/pci/hotplug/acpiphp_glue.c
===================================================================
--- work-fault-inject.orig/drivers/pci/hotplug/acpiphp_glue.c
+++ work-fault-inject/drivers/pci/hotplug/acpiphp_glue.c
@@ -1693,14 +1693,10 @@ void __exit acpiphp_glue_exit(void)
*/
int __init acpiphp_get_num_slots(void)
{
- struct list_head *node;
struct acpiphp_bridge *bridge;
- int num_slots;
-
- num_slots = 0;
+ int num_slots = 0;
- list_for_each (node, &bridge_list) {
- bridge = (struct acpiphp_bridge *)node;
+ list_for_each_entry (bridge, &bridge_list, list) {
dbg("Bus %04x:%02x has %d slot%s\n",
pci_domain_nr(bridge->pci_bus),
bridge->pci_bus->number, bridge->nr_slots,
-
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