Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 321504
b: refs/heads/master
c: e4ea691
h: refs/heads/master
v: v3
  • Loading branch information
Aaro Koskinen authored and Marek Szyprowski committed Aug 9, 2012
1 parent d5e7168 commit d8cc86f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 39f78e70567a07a6fc0d7a4ca9e3331e44dd400d
refs/heads/master: e4ea6918c93b9f59d34e8ca2124b2b64b1afe73b
6 changes: 3 additions & 3 deletions trunk/arch/arm/mm/dma-mapping.c
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ static void *__alloc_from_pool(size_t size, struct page **ret_page)
unsigned int pageno;
unsigned long flags;
void *ptr = NULL;
size_t align;
unsigned long align_mask;

if (!pool->vaddr) {
WARN(1, "coherent pool not initialised!\n");
Expand All @@ -435,11 +435,11 @@ static void *__alloc_from_pool(size_t size, struct page **ret_page)
* small, so align them to their order in pages, minimum is a page
* size. This helps reduce fragmentation of the DMA space.
*/
align = PAGE_SIZE << get_order(size);
align_mask = (1 << get_order(size)) - 1;

spin_lock_irqsave(&pool->lock, flags);
pageno = bitmap_find_next_zero_area(pool->bitmap, pool->nr_pages,
0, count, (1 << align) - 1);
0, count, align_mask);
if (pageno < pool->nr_pages) {
bitmap_set(pool->bitmap, pageno, count);
ptr = pool->vaddr + PAGE_SIZE * pageno;
Expand Down

0 comments on commit d8cc86f

Please sign in to comment.