aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc
diff options
context:
space:
mode:
authorPavel Emelianov <xemul@openvz.org>2007-05-03 18:13:45 -0400
committerDavid S. Miller <davem@davemloft.net>2007-05-03 18:13:45 -0400
commit7562f876cd93800f2f8c89445f2a563590b24e09 (patch)
tree78a34c011af275efa0d55ba59c3bd49b771dd533 /net/tipc
parent03fba0479600114f32d29eee74ca3eaa364606bf (diff)
[NET]: Rework dev_base via list_head (v3)
Cleanup of dev_base list use, with the aim to simplify making device list per-namespace. In almost every occasion, use of dev_base variable and dev->next pointer could be easily replaced by for_each_netdev loop. A few most complicated places were converted to using first_netdev()/next_netdev(). Signed-off-by: Pavel Emelianov <xemul@openvz.org> Acked-by: Kirill Korotaev <dev@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc')
-rw-r--r--net/tipc/eth_media.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/net/tipc/eth_media.c b/net/tipc/eth_media.c
index 67bb29b44d1b..0ee6ded18f3a 100644
--- a/net/tipc/eth_media.c
+++ b/net/tipc/eth_media.c
@@ -120,16 +120,18 @@ static int recv_msg(struct sk_buff *buf, struct net_device *dev,
120 120
121static int enable_bearer(struct tipc_bearer *tb_ptr) 121static int enable_bearer(struct tipc_bearer *tb_ptr)
122{ 122{
123 struct net_device *dev = dev_base; 123 struct net_device *dev, *pdev;
124 struct eth_bearer *eb_ptr = &eth_bearers[0]; 124 struct eth_bearer *eb_ptr = &eth_bearers[0];
125 struct eth_bearer *stop = &eth_bearers[MAX_ETH_BEARERS]; 125 struct eth_bearer *stop = &eth_bearers[MAX_ETH_BEARERS];
126 char *driver_name = strchr((const char *)tb_ptr->name, ':') + 1; 126 char *driver_name = strchr((const char *)tb_ptr->name, ':') + 1;
127 127
128 /* Find device with specified name */ 128 /* Find device with specified name */
129 129 dev = NULL;
130 while (dev && dev->name && strncmp(dev->name, driver_name, IFNAMSIZ)) { 130 for_each_netdev(pdev)
131 dev = dev->next; 131 if (!strncmp(dev->name, driver_name, IFNAMSIZ)) {
132 } 132 dev = pdev;
133 break;
134 }
133 if (!dev) 135 if (!dev)
134 return -ENODEV; 136 return -ENODEV;
135 137