phonet: use for_each_set_bit()
Subsystems (3)
PATCH 1/5 phonet: use for_each_set_bit()
From: Akinobu Mita <[email protected]>
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]>
---
net/phonet/pn_dev.c | 3 +-- net/phonet/pn_netlink.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-)
net/phonet/pn_dev.c renamed from net/phonet/pn_dev.c~phonet-use-for_each_set_bit +1 -2
@@ -107,8 +107,7 @@ static void phonet_device_destroy(structif (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); }
net/phonet/pn_netlink.c renamed from net/phonet/pn_netlink.c~phonet-use-for_each_set_bit +1 -2
@@ -141,8 +141,7 @@ static int getaddr_dumpit(struct sk_buffcontinue ; 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 ;
_
Quoted 7 lines · On Thu, 11 Mar 2010 14:07:49 -0800, [email protected] wrote:
From: Akinobu Mita <[email protected]>
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]>
Signature · 3 lines
Rémi Denis-Courmont http://www.remlab.net http://fi.linkedin.com/in/remidenis
From: [email protected]
Date: Thu, 11 Mar 2010 14:07:49 -0800
Quoted 7 lines
From: Akinobu Mita <[email protected]>
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]>
Applied.