From: Wei Yongjun Date: Mon, 11 Mar 2013 05:43:48 +0000 (+0000) Subject: bridge: using for_each_set_bit_from to simplify the code X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5096e3c4b2815da79a7ee1533349b2f21a698622;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git bridge: using for_each_set_bit_from to simplify the code Using for_each_set_bit_from() to simplify the code. Signed-off-by: Wei Yongjun Signed-off-by: David S. Miller --- diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c index b0812c91c0f0..48fe76176a22 100644 --- a/net/bridge/br_fdb.c +++ b/net/bridge/br_fdb.c @@ -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);