summaryrefslogtreecommitdiff
path: root/net/tipc
diff options
context:
space:
mode:
authorPavel Emelianov <xemul@openvz.org>2007-05-03 15:13:45 -0700
committerDavid S. Miller <davem@davemloft.net>2007-05-03 15:13:45 -0700
commit7562f876cd93800f2f8c89445f2a563590b24e09 (patch)
tree78a34c011af275efa0d55ba59c3bd49b771dd533 /net/tipc
parent03fba0479600114f32d29eee74ca3eaa364606bf (diff)
downloadlinux-3.10-7562f876cd93800f2f8c89445f2a563590b24e09.tar.gz
linux-3.10-7562f876cd93800f2f8c89445f2a563590b24e09.tar.bz2
linux-3.10-7562f876cd93800f2f8c89445f2a563590b24e09.zip
[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 67bb29b44d1..0ee6ded18f3 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,
static int enable_bearer(struct tipc_bearer *tb_ptr)
{
- struct net_device *dev = dev_base;
+ struct net_device *dev, *pdev;
struct eth_bearer *eb_ptr = &eth_bearers[0];
struct eth_bearer *stop = &eth_bearers[MAX_ETH_BEARERS];
char *driver_name = strchr((const char *)tb_ptr->name, ':') + 1;
/* Find device with specified name */
-
- while (dev && dev->name && strncmp(dev->name, driver_name, IFNAMSIZ)) {
- dev = dev->next;
- }
+ dev = NULL;
+ for_each_netdev(pdev)
+ if (!strncmp(dev->name, driver_name, IFNAMSIZ)) {
+ dev = pdev;
+ break;
+ }
if (!dev)
return -ENODEV;