Skip to content

Commit

Permalink
phonet: use for_each_set_bit()
Browse files Browse the repository at this point in the history
Replace open-coded loop with for_each_set_bit().

Signed-off-by: Akinobu Mita <[email protected]>
Cc: "David S. Miller" <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Acked-by: Rémi Denis-Courmont <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
mita authored and davem330 committed Mar 15, 2010
1 parent f28f9e4 commit a1ca14a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions net/phonet/pn_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
3 changes: 1 addition & 2 deletions net/phonet/pn_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit a1ca14a

Please sign in to comment.