From: Akinobu Mita Date: Fri, 23 Mar 2012 22:02:05 +0000 (-0700) Subject: uwb: use for_each_clear_bit() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1a07cbba1425ec7215854cfaa9a8df66047cfb57;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git uwb: use for_each_clear_bit() Use for_each_clear_bit() to iterate over all the cleared bit in a memory region. Signed-off-by: Akinobu Mita Cc: Stefano Panella Cc: David Vrabel Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/uwb/allocator.c b/drivers/uwb/allocator.c index e45e673b8770..6e3e713f0ef7 100644 --- a/drivers/uwb/allocator.c +++ b/drivers/uwb/allocator.c @@ -334,10 +334,8 @@ int uwb_rsv_find_best_allocation(struct uwb_rsv *rsv, struct uwb_mas_bm *availab /* fill the not available vector from the available bm */ - for (bit_index = 0; bit_index < UWB_NUM_MAS; bit_index++) { - if (!test_bit(bit_index, available->bm)) - ai->bm[bit_index] = UWB_RSV_MAS_NOT_AVAIL; - } + for_each_clear_bit(bit_index, available->bm, UWB_NUM_MAS) + ai->bm[bit_index] = UWB_RSV_MAS_NOT_AVAIL; if (ai->max_interval == 1) { get_row_descriptors(ai);