提交 467c442f 编写于 作者: A Akinobu Mita 提交者: Greg Kroah-Hartman

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.
Signed-off-by: NAkinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: NKristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 a2302c68
......@@ -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,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册