diff options
author | Pavel Emelianov <xemul@openvz.org> | 2007-05-03 18:13:45 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2007-05-03 18:13:45 -0400 |
commit | 7562f876cd93800f2f8c89445f2a563590b24e09 (patch) | |
tree | 78a34c011af275efa0d55ba59c3bd49b771dd533 /net/tipc/eth_media.c | |
parent | 03fba0479600114f32d29eee74ca3eaa364606bf (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/eth_media.c')
-rw-r--r-- | net/tipc/eth_media.c | 12 |
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 | ||
121 | static int enable_bearer(struct tipc_bearer *tb_ptr) | 121 | static 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 = ð_bearers[0]; | 124 | struct eth_bearer *eb_ptr = ð_bearers[0]; |
125 | struct eth_bearer *stop = ð_bearers[MAX_ETH_BEARERS]; | 125 | struct eth_bearer *stop = ð_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 | ||