diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2009-12-15 19:48:30 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-16 10:20:19 -0500 |
commit | e756fd8080622998007b592bd33f86cecf56587a (patch) | |
tree | a39e0bea4984e28fedefb196ebaf1a95e89778fc /arch/sparc/kernel | |
parent | 43ff8b60853793fb0155b3e465739d2170c3aa2f (diff) |
sparc: use bitmap_find_next_zero_area
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Acked-by: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/sparc/kernel')
-rw-r--r-- | arch/sparc/kernel/ldc.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/arch/sparc/kernel/ldc.c b/arch/sparc/kernel/ldc.c index e0ba898e30cf..df39a0f0d27a 100644 --- a/arch/sparc/kernel/ldc.c +++ b/arch/sparc/kernel/ldc.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/interrupt.h> | 14 | #include <linux/interrupt.h> |
15 | #include <linux/list.h> | 15 | #include <linux/list.h> |
16 | #include <linux/init.h> | 16 | #include <linux/init.h> |
17 | #include <linux/bitmap.h> | ||
17 | 18 | ||
18 | #include <asm/hypervisor.h> | 19 | #include <asm/hypervisor.h> |
19 | #include <asm/iommu.h> | 20 | #include <asm/iommu.h> |
@@ -1875,7 +1876,7 @@ EXPORT_SYMBOL(ldc_read); | |||
1875 | static long arena_alloc(struct ldc_iommu *iommu, unsigned long npages) | 1876 | static long arena_alloc(struct ldc_iommu *iommu, unsigned long npages) |
1876 | { | 1877 | { |
1877 | struct iommu_arena *arena = &iommu->arena; | 1878 | struct iommu_arena *arena = &iommu->arena; |
1878 | unsigned long n, i, start, end, limit; | 1879 | unsigned long n, start, end, limit; |
1879 | int pass; | 1880 | int pass; |
1880 | 1881 | ||
1881 | limit = arena->limit; | 1882 | limit = arena->limit; |
@@ -1883,7 +1884,7 @@ static long arena_alloc(struct ldc_iommu *iommu, unsigned long npages) | |||
1883 | pass = 0; | 1884 | pass = 0; |
1884 | 1885 | ||
1885 | again: | 1886 | again: |
1886 | n = find_next_zero_bit(arena->map, limit, start); | 1887 | n = bitmap_find_next_zero_area(arena->map, limit, start, npages, 0); |
1887 | end = n + npages; | 1888 | end = n + npages; |
1888 | if (unlikely(end >= limit)) { | 1889 | if (unlikely(end >= limit)) { |
1889 | if (likely(pass < 1)) { | 1890 | if (likely(pass < 1)) { |
@@ -1896,16 +1897,7 @@ again: | |||
1896 | return -1; | 1897 | return -1; |
1897 | } | 1898 | } |
1898 | } | 1899 | } |
1899 | 1900 | bitmap_set(arena->map, n, npages); | |
1900 | for (i = n; i < end; i++) { | ||
1901 | if (test_bit(i, arena->map)) { | ||
1902 | start = i + 1; | ||
1903 | goto again; | ||
1904 | } | ||
1905 | } | ||
1906 | |||
1907 | for (i = n; i < end; i++) | ||
1908 | __set_bit(i, arena->map); | ||
1909 | 1901 | ||
1910 | arena->hint = end; | 1902 | arena->hint = end; |
1911 | 1903 | ||