[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1255076961-21325-1-git-send-email-akinobu.mita@gmail.com>
Date: Fri, 9 Oct 2009 17:29:14 +0900
From: Akinobu Mita <akinobu.mita@...il.com>
To: linux-kernel@...r.kernel.org, akpm@...ux-foundation.org
Cc: Akinobu Mita <akinobu.mita@...il.com>,
FUJITA Tomonori <fujita.tomonori@....ntt.co.jp>
Subject: [PATCH 1/8] iommu-helper: Simplify find_next_zero_area
Use find_next_bit instead of doing test_bit for each bit
Cc: FUJITA Tomonori <fujita.tomonori@....ntt.co.jp>
Signed-off-by: Akinobu Mita <akinobu.mita@...il.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists