bridge: using for_each_set_bit_from to simplify the code