diff options
author | Yijing Wang <wangyijing@huawei.com> | 2014-02-13 08:14:02 -0500 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2014-02-14 13:20:51 -0500 |
commit | 560698e9d2ca77d0adb07f3cf0ebfe519859c528 (patch) | |
tree | d5c715de0d7fd11b2da475e50213ec67d1127295 /drivers/pcmcia | |
parent | 3bc955987fb377f3c95bc29deb498e96819b8451 (diff) |
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>
Diffstat (limited to 'drivers/pcmcia')
-rw-r--r-- | drivers/pcmcia/yenta_socket.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c index 8485761e76af..946f90ef6020 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) | |||
1076 | */ | 1076 | */ |
1077 | static void yenta_fixup_parent_bridge(struct pci_bus *cardbus_bridge) | 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 | unsigned char upper_limit; | 1080 | unsigned char upper_limit; |
1081 | /* | 1081 | /* |
1082 | * We only check and fix the parent bridge: All systems which need | 1082 | * We only check and fix the parent bridge: All systems which need |
@@ -1095,18 +1095,18 @@ static void yenta_fixup_parent_bridge(struct pci_bus *cardbus_bridge) | |||
1095 | /* stay within the limits of the bus range of the parent: */ | 1095 | /* stay within the limits of the bus range of the parent: */ |
1096 | upper_limit = bridge_to_fix->parent->busn_res.end; | 1096 | upper_limit = bridge_to_fix->parent->busn_res.end; |
1097 | 1097 | ||
1098 | /* check the bus ranges of all silbling bridges to prevent overlap */ | 1098 | /* check the bus ranges of all sibling bridges to prevent overlap */ |
1099 | list_for_each(tmp, &bridge_to_fix->parent->children) { | 1099 | list_for_each_entry(sibling, &bridge_to_fix->parent->children, |
1100 | struct pci_bus *silbling = pci_bus_b(tmp); | 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 | * and it's secondary is equal or smaller than our | 1103 | * and it's secondary is equal or smaller than our |
1104 | * current upper limit, set the new upper limit to | 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 | 1107 | if (sibling->busn_res.start > bridge_to_fix->busn_res.end |
1108 | && silbling->busn_res.start <= upper_limit) | 1108 | && sibling->busn_res.start <= upper_limit) |
1109 | upper_limit = silbling->busn_res.start - 1; | 1109 | upper_limit = sibling->busn_res.start - 1; |
1110 | } | 1110 | } |
1111 | 1111 | ||
1112 | /* Show that the wanted subordinate number is not possible: */ | 1112 | /* Show that the wanted subordinate number is not possible: */ |