Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 107680
b: refs/heads/master
c: d2dc1f4
h: refs/heads/master
v: v3
  • Loading branch information
Jan Beulich authored and Linus Torvalds committed Aug 5, 2008
1 parent 32f90c5 commit c6aeefe
Show file tree
Hide file tree
Showing 2 changed files with 3 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: 978cc90c469b38bcbbfd00a8c183d74e5b17bf45
refs/heads/master: d2dc1f4adb4b5b02d87e49e115e5107f4da790c0
5 changes: 2 additions & 3 deletions trunk/kernel/dma-coherent.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,14 @@ void *dma_mark_declared_memory_occupied(struct device *dev,
{
struct dma_coherent_mem *mem = dev->dma_mem;
int pos, err;
int pages = (size + (device_addr & ~PAGE_MASK) + PAGE_SIZE - 1);

pages >>= PAGE_SHIFT;
size += device_addr & ~PAGE_MASK;

if (!mem)
return ERR_PTR(-EINVAL);

pos = (device_addr - mem->device_base) >> PAGE_SHIFT;
err = bitmap_allocate_region(mem->bitmap, pos, get_order(pages));
err = bitmap_allocate_region(mem->bitmap, pos, get_order(size));
if (err != 0)
return ERR_PTR(err);
return mem->virt_base + (pos << PAGE_SHIFT);
Expand Down

0 comments on commit c6aeefe

Please sign in to comment.