diff options
author | Joerg Roedel <joerg.roedel@amd.com> | 2008-10-16 01:02:09 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-16 14:21:33 -0400 |
commit | 3400001c531d283068a60e9f884f7de6f22314be (patch) | |
tree | bb696abb3d2854889ddd50b1e2262bf60a2ad251 /arch/powerpc/kernel/iommu.c | |
parent | a7375762a5dca3e468f17e0b2e312b362dc9ef4c (diff) |
powerpc: rename iommu_num_pages function to iommu_nr_pages
This is a preparation patch for introducing a generic iommu_num_pages function.
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Muli Ben-Yehuda <muli@il.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/powerpc/kernel/iommu.c')
-rw-r--r-- | arch/powerpc/kernel/iommu.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c index 550a19399bfa..e2cf6320907e 100644 --- a/arch/powerpc/kernel/iommu.c +++ b/arch/powerpc/kernel/iommu.c | |||
@@ -51,7 +51,7 @@ static int protect4gb = 1; | |||
51 | 51 | ||
52 | static void __iommu_free(struct iommu_table *, dma_addr_t, unsigned int); | 52 | static void __iommu_free(struct iommu_table *, dma_addr_t, unsigned int); |
53 | 53 | ||
54 | static inline unsigned long iommu_num_pages(unsigned long vaddr, | 54 | static inline unsigned long iommu_nr_pages(unsigned long vaddr, |
55 | unsigned long slen) | 55 | unsigned long slen) |
56 | { | 56 | { |
57 | unsigned long npages; | 57 | unsigned long npages; |
@@ -325,7 +325,7 @@ int iommu_map_sg(struct device *dev, struct iommu_table *tbl, | |||
325 | } | 325 | } |
326 | /* Allocate iommu entries for that segment */ | 326 | /* Allocate iommu entries for that segment */ |
327 | vaddr = (unsigned long) sg_virt(s); | 327 | vaddr = (unsigned long) sg_virt(s); |
328 | npages = iommu_num_pages(vaddr, slen); | 328 | npages = iommu_nr_pages(vaddr, slen); |
329 | align = 0; | 329 | align = 0; |
330 | if (IOMMU_PAGE_SHIFT < PAGE_SHIFT && slen >= PAGE_SIZE && | 330 | if (IOMMU_PAGE_SHIFT < PAGE_SHIFT && slen >= PAGE_SIZE && |
331 | (vaddr & ~PAGE_MASK) == 0) | 331 | (vaddr & ~PAGE_MASK) == 0) |
@@ -418,7 +418,7 @@ int iommu_map_sg(struct device *dev, struct iommu_table *tbl, | |||
418 | unsigned long vaddr, npages; | 418 | unsigned long vaddr, npages; |
419 | 419 | ||
420 | vaddr = s->dma_address & IOMMU_PAGE_MASK; | 420 | vaddr = s->dma_address & IOMMU_PAGE_MASK; |
421 | npages = iommu_num_pages(s->dma_address, s->dma_length); | 421 | npages = iommu_nr_pages(s->dma_address, s->dma_length); |
422 | __iommu_free(tbl, vaddr, npages); | 422 | __iommu_free(tbl, vaddr, npages); |
423 | s->dma_address = DMA_ERROR_CODE; | 423 | s->dma_address = DMA_ERROR_CODE; |
424 | s->dma_length = 0; | 424 | s->dma_length = 0; |
@@ -452,7 +452,7 @@ void iommu_unmap_sg(struct iommu_table *tbl, struct scatterlist *sglist, | |||
452 | 452 | ||
453 | if (sg->dma_length == 0) | 453 | if (sg->dma_length == 0) |
454 | break; | 454 | break; |
455 | npages = iommu_num_pages(dma_handle, sg->dma_length); | 455 | npages = iommu_nr_pages(dma_handle, sg->dma_length); |
456 | __iommu_free(tbl, dma_handle, npages); | 456 | __iommu_free(tbl, dma_handle, npages); |
457 | sg = sg_next(sg); | 457 | sg = sg_next(sg); |
458 | } | 458 | } |
@@ -584,7 +584,7 @@ dma_addr_t iommu_map_single(struct device *dev, struct iommu_table *tbl, | |||
584 | BUG_ON(direction == DMA_NONE); | 584 | BUG_ON(direction == DMA_NONE); |
585 | 585 | ||
586 | uaddr = (unsigned long)vaddr; | 586 | uaddr = (unsigned long)vaddr; |
587 | npages = iommu_num_pages(uaddr, size); | 587 | npages = iommu_nr_pages(uaddr, size); |
588 | 588 | ||
589 | if (tbl) { | 589 | if (tbl) { |
590 | align = 0; | 590 | align = 0; |
@@ -617,7 +617,7 @@ void iommu_unmap_single(struct iommu_table *tbl, dma_addr_t dma_handle, | |||
617 | BUG_ON(direction == DMA_NONE); | 617 | BUG_ON(direction == DMA_NONE); |
618 | 618 | ||
619 | if (tbl) { | 619 | if (tbl) { |
620 | npages = iommu_num_pages(dma_handle, size); | 620 | npages = iommu_nr_pages(dma_handle, size); |
621 | iommu_free(tbl, dma_handle, npages); | 621 | iommu_free(tbl, dma_handle, npages); |
622 | } | 622 | } |
623 | } | 623 | } |