lkml.org 
[lkml]   [2009]   [Oct]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 1/8] iommu-helper: Simplify find_next_zero_area
    Date
    Use find_next_bit instead of doing test_bit for each bit

    Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
    Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
    ---
    lib/iommu-helper.c | 9 ++++-----
    1 files changed, 4 insertions(+), 5 deletions(-)

    diff --git a/lib/iommu-helper.c b/lib/iommu-helper.c
    index 75dbda0..dddbf22 100644
    --- a/lib/iommu-helper.c
    +++ b/lib/iommu-helper.c
    @@ -21,11 +21,10 @@ again:
    end = index + nr;
    if (end >= size)
    return -1;
    - for (i = index; i < end; i++) {
    - if (test_bit(i, map)) {
    - start = i+1;
    - goto again;
    - }
    + i = find_next_bit(map, end, index);
    + if (i < end) {
    + start = i + 1;
    + goto again;
    }
    return index;
    }
    --
    1.5.4.3


    \
     
     \ /
      Last update: 2009-10-09 10:47    [W:4.055 / U:0.344 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site