Patchwork phonet: use for_each_set_bit

login
register
mail settings
Submitter Akinobu Mita
Date Aug. 28, 2010, 5:08 a.m.
Message ID <1282972106-9914-1-git-send-email-akinobu.mita@gmail.com>
Download mbox | patch
Permalink /patch/62891/
State Accepted
Delegated to: David Miller
Headers show

Comments

Akinobu Mita - Aug. 28, 2010, 5:08 a.m.
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>
Cc: netdev@vger.kernel.org
---
 net/phonet/pn_dev.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
David Miller - Aug. 28, 2010, 10:37 p.m.
From: Akinobu Mita <akinobu.mita@gmail.com>
Date: Sat, 28 Aug 2010 14:08:26 +0900

> 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>
> Cc: netdev@vger.kernel.org

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/net/phonet/pn_dev.c b/net/phonet/pn_dev.c
index b18e48f..d0a4294 100644
--- a/net/phonet/pn_dev.c
+++ b/net/phonet/pn_dev.c
@@ -292,8 +292,7 @@  static void phonet_route_autodel(struct net_device *dev)
 	if (bitmap_empty(deleted, 64))
 		return; /* short-circuit RCU */
 	synchronize_rcu();
-	for (i = find_first_bit(deleted, 64); i < 64;
-			i = find_next_bit(deleted, 64, i + 1)) {
+	for_each_set_bit(i, deleted, 64) {
 		rtm_phonet_notify(RTM_DELROUTE, dev, i);
 		dev_put(dev);
 	}