Skip to content

Commit

Permalink
bridge: using for_each_set_bit_from to simplify the code
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wei Yongjun authored and David S. Miller committed Mar 12, 2013
1 parent 3a918f4 commit 5096e3c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions net/bridge/br_fdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 5096e3c

Please sign in to comment.