Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pcmcia: Use list_for_each_entry() for bus traversal

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

[bhelgaas: fix "silbling" typo]
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>

authored by

Yijing Wang and committed by
Bjorn Helgaas
560698e9 3bc95598

+9 -9
+9 -9
drivers/pcmcia/yenta_socket.c
··· 1076 1076 */ 1077 1077 static void yenta_fixup_parent_bridge(struct pci_bus *cardbus_bridge) 1078 1078 { 1079 - struct list_head *tmp; 1079 + struct pci_bus *sibling; 1080 1080 unsigned char upper_limit; 1081 1081 /* 1082 1082 * We only check and fix the parent bridge: All systems which need ··· 1095 1095 /* stay within the limits of the bus range of the parent: */ 1096 1096 upper_limit = bridge_to_fix->parent->busn_res.end; 1097 1097 1098 - /* check the bus ranges of all silbling bridges to prevent overlap */ 1099 - list_for_each(tmp, &bridge_to_fix->parent->children) { 1100 - struct pci_bus *silbling = pci_bus_b(tmp); 1098 + /* check the bus ranges of all sibling bridges to prevent overlap */ 1099 + list_for_each_entry(sibling, &bridge_to_fix->parent->children, 1100 + node) { 1101 1101 /* 1102 - * If the silbling has a higher secondary bus number 1102 + * If the sibling has a higher secondary bus number 1103 1103 * and it's secondary is equal or smaller than our 1104 1104 * current upper limit, set the new upper limit to 1105 - * the bus number below the silbling's range: 1105 + * the bus number below the sibling's range: 1106 1106 */ 1107 - if (silbling->busn_res.start > bridge_to_fix->busn_res.end 1108 - && silbling->busn_res.start <= upper_limit) 1109 - upper_limit = silbling->busn_res.start - 1; 1107 + if (sibling->busn_res.start > bridge_to_fix->busn_res.end 1108 + && sibling->busn_res.start <= upper_limit) 1109 + upper_limit = sibling->busn_res.start - 1; 1110 1110 } 1111 1111 1112 1112 /* Show that the wanted subordinate number is not possible: */