aboutsummaryrefslogtreecommitdiffstats
path: root/net/rose/rose_route.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/rose/rose_route.c')
-rw-r--r--net/rose/rose_route.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/net/rose/rose_route.c b/net/rose/rose_route.c
index 1f9aefd95a99..929a784a86d7 100644
--- a/net/rose/rose_route.c
+++ b/net/rose/rose_route.c
@@ -596,7 +596,7 @@ struct net_device *rose_dev_first(void)
596 struct net_device *dev, *first = NULL; 596 struct net_device *dev, *first = NULL;
597 597
598 read_lock(&dev_base_lock); 598 read_lock(&dev_base_lock);
599 for (dev = dev_base; dev != NULL; dev = dev->next) { 599 for_each_netdev(dev) {
600 if ((dev->flags & IFF_UP) && dev->type == ARPHRD_ROSE) 600 if ((dev->flags & IFF_UP) && dev->type == ARPHRD_ROSE)
601 if (first == NULL || strncmp(dev->name, first->name, 3) < 0) 601 if (first == NULL || strncmp(dev->name, first->name, 3) < 0)
602 first = dev; 602 first = dev;
@@ -614,12 +614,13 @@ struct net_device *rose_dev_get(rose_address *addr)
614 struct net_device *dev; 614 struct net_device *dev;
615 615
616 read_lock(&dev_base_lock); 616 read_lock(&dev_base_lock);
617 for (dev = dev_base; dev != NULL; dev = dev->next) { 617 for_each_netdev(dev) {
618 if ((dev->flags & IFF_UP) && dev->type == ARPHRD_ROSE && rosecmp(addr, (rose_address *)dev->dev_addr) == 0) { 618 if ((dev->flags & IFF_UP) && dev->type == ARPHRD_ROSE && rosecmp(addr, (rose_address *)dev->dev_addr) == 0) {
619 dev_hold(dev); 619 dev_hold(dev);
620 goto out; 620 goto out;
621 } 621 }
622 } 622 }
623 dev = NULL;
623out: 624out:
624 read_unlock(&dev_base_lock); 625 read_unlock(&dev_base_lock);
625 return dev; 626 return dev;
@@ -630,10 +631,11 @@ static int rose_dev_exists(rose_address *addr)
630 struct net_device *dev; 631 struct net_device *dev;
631 632
632 read_lock(&dev_base_lock); 633 read_lock(&dev_base_lock);
633 for (dev = dev_base; dev != NULL; dev = dev->next) { 634 for_each_netdev(dev) {
634 if ((dev->flags & IFF_UP) && dev->type == ARPHRD_ROSE && rosecmp(addr, (rose_address *)dev->dev_addr) == 0) 635 if ((dev->flags & IFF_UP) && dev->type == ARPHRD_ROSE && rosecmp(addr, (rose_address *)dev->dev_addr) == 0)
635 goto out; 636 goto out;
636 } 637 }
638 dev = NULL;
637out: 639out:
638 read_unlock(&dev_base_lock); 640 read_unlock(&dev_base_lock);
639 return dev != NULL; 641 return dev != NULL;