bridge: using for_each_set_bit_from to simplify the code
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Mon, 11 Mar 2013 05:43:48 +0000 (05:43 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 12 Mar 2013 12:04:08 +0000 (08:04 -0400)
Using for_each_set_bit_from() to simplify the code.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/bridge/br_fdb.c

index b0812c91c0f0ea6d4010722990a044c72d93ba36..48fe76176a22d7ea46b97ebfc4414b3b046a2230 100644 (file)
@@ -161,9 +161,7 @@ void br_fdb_change_mac_address(struct net_bridge *br, const u8 *newaddr)
        if (!pv)
                return;
 
-       for (vid = find_next_bit(pv->vlan_bitmap, BR_VLAN_BITMAP_LEN, vid);
-            vid < BR_VLAN_BITMAP_LEN;
-            vid = find_next_bit(pv->vlan_bitmap, BR_VLAN_BITMAP_LEN, vid+1)) {
+       for_each_set_bit_from(vid, pv->vlan_bitmap, BR_VLAN_BITMAP_LEN) {
                f = __br_fdb_get(br, br->dev->dev_addr, vid);
                if (f && f->is_local && !f->dst)
                        fdb_delete(br, f);