]> git.baikalelectronics.ru Git - kernel.git/commitdiff
phonet: use for_each_set_bit()
authorAkinobu Mita <akinobu.mita@gmail.com>
Thu, 11 Mar 2010 12:07:49 +0000 (12:07 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 15 Mar 2010 23:00:47 +0000 (16:00 -0700)
Replace open-coded loop with for_each_set_bit().

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: RĂ©mi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/phonet/pn_dev.c
net/phonet/pn_netlink.c

index c597cc53a6fb2d3433c70beea0f05fdc982d5a21..5c6ae0c701c047866bae808b77db22e8fc8ddad0 100644 (file)
@@ -107,8 +107,7 @@ static void phonet_device_destroy(struct net_device *dev)
        if (pnd) {
                u8 addr;
 
-               for (addr = find_first_bit(pnd->addrs, 64); addr < 64;
-                       addr = find_next_bit(pnd->addrs, 64, 1+addr))
+               for_each_set_bit(addr, pnd->addrs, 64)
                        phonet_address_notify(RTM_DELADDR, dev, addr);
                kfree(pnd);
        }
index 2e6c7eb8e76add27fabc042825e8bda8f9886d06..fe2e7088ee07b10d387aa5db7b6bc9e7d369853a 100644 (file)
@@ -141,8 +141,7 @@ static int getaddr_dumpit(struct sk_buff *skb, struct netlink_callback *cb)
                        continue;
 
                addr_idx = 0;
-               for (addr = find_first_bit(pnd->addrs, 64); addr < 64;
-                       addr = find_next_bit(pnd->addrs, 64, 1+addr)) {
+               for_each_set_bit(addr, pnd->addrs, 64) {
                        if (addr_idx++ < addr_start_idx)
                                continue;