diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2010-03-11 07:07:49 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-03-15 19:00:47 -0400 |
commit | a1ca14ac54675d3bf48d442b5a7b9eba133f1888 (patch) | |
tree | 4c140c289bf166b99f716cc685a34097520681d0 | |
parent | f28f9e43b3d81d1e69da0ebf77c8a6780cb5e0c8 (diff) |
phonet: use for_each_set_bit()
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>
-rw-r--r-- | net/phonet/pn_dev.c | 3 | ||||
-rw-r--r-- | net/phonet/pn_netlink.c | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/net/phonet/pn_dev.c b/net/phonet/pn_dev.c index c597cc53a6fb..5c6ae0c701c0 100644 --- a/net/phonet/pn_dev.c +++ b/net/phonet/pn_dev.c | |||
@@ -107,8 +107,7 @@ static void phonet_device_destroy(struct net_device *dev) | |||
107 | if (pnd) { | 107 | if (pnd) { |
108 | u8 addr; | 108 | u8 addr; |
109 | 109 | ||
110 | for (addr = find_first_bit(pnd->addrs, 64); addr < 64; | 110 | for_each_set_bit(addr, pnd->addrs, 64) |
111 | addr = find_next_bit(pnd->addrs, 64, 1+addr)) | ||
112 | phonet_address_notify(RTM_DELADDR, dev, addr); | 111 | phonet_address_notify(RTM_DELADDR, dev, addr); |
113 | kfree(pnd); | 112 | kfree(pnd); |
114 | } | 113 | } |
diff --git a/net/phonet/pn_netlink.c b/net/phonet/pn_netlink.c index 2e6c7eb8e76a..fe2e7088ee07 100644 --- a/net/phonet/pn_netlink.c +++ b/net/phonet/pn_netlink.c | |||
@@ -141,8 +141,7 @@ static int getaddr_dumpit(struct sk_buff *skb, struct netlink_callback *cb) | |||
141 | continue; | 141 | continue; |
142 | 142 | ||
143 | addr_idx = 0; | 143 | addr_idx = 0; |
144 | for (addr = find_first_bit(pnd->addrs, 64); addr < 64; | 144 | for_each_set_bit(addr, pnd->addrs, 64) { |
145 | addr = find_next_bit(pnd->addrs, 64, 1+addr)) { | ||
146 | if (addr_idx++ < addr_start_idx) | 145 | if (addr_idx++ < addr_start_idx) |
147 | continue; | 146 | continue; |
148 | 147 | ||