aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86_64/kernel/pci-calgary.c
diff options
context:
space:
mode:
authorMuli Ben-Yehuda <muli@il.ibm.com>2007-07-21 11:11:06 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-21 21:37:12 -0400
commit3cc39bda26c90782f98305c34a7f769819784a61 (patch)
tree173d70ca1c58108041d71abec04cf5662cbccd44 /arch/x86_64/kernel/pci-calgary.c
parent0b11e1c6a604014283af70e27e0f32971407fd6d (diff)
x86_64: Calgary - fold in redundant functions
After the bitmap changes we can get rid of the unlocked versions of calgary_unmap_sg and iommu_free. Fold __calgary_unmap_sg and __iommu_free into their calgary_unmap_sg and iommu_free, respectively. Signed-off-by: Muli Ben-Yehuda <muli@il.ibm.com> Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/x86_64/kernel/pci-calgary.c')
-rw-r--r--arch/x86_64/kernel/pci-calgary.c30
1 files changed, 9 insertions, 21 deletions
diff --git a/arch/x86_64/kernel/pci-calgary.c b/arch/x86_64/kernel/pci-calgary.c
index d10fee8c2418..86927d5b8463 100644
--- a/arch/x86_64/kernel/pci-calgary.c
+++ b/arch/x86_64/kernel/pci-calgary.c
@@ -321,7 +321,7 @@ error:
321 return bad_dma_address; 321 return bad_dma_address;
322} 322}
323 323
324static void __iommu_free(struct iommu_table *tbl, dma_addr_t dma_addr, 324static void iommu_free(struct iommu_table *tbl, dma_addr_t dma_addr,
325 unsigned int npages) 325 unsigned int npages)
326{ 326{
327 unsigned long entry; 327 unsigned long entry;
@@ -359,12 +359,6 @@ static void __iommu_free(struct iommu_table *tbl, dma_addr_t dma_addr,
359 spin_unlock_irqrestore(&tbl->it_lock, flags); 359 spin_unlock_irqrestore(&tbl->it_lock, flags);
360} 360}
361 361
362static void iommu_free(struct iommu_table *tbl, dma_addr_t dma_addr,
363 unsigned int npages)
364{
365 __iommu_free(tbl, dma_addr, npages);
366}
367
368static inline struct iommu_table *find_iommu_table(struct device *dev) 362static inline struct iommu_table *find_iommu_table(struct device *dev)
369{ 363{
370 struct pci_dev *pdev; 364 struct pci_dev *pdev;
@@ -387,9 +381,14 @@ static inline struct iommu_table *find_iommu_table(struct device *dev)
387 return tbl; 381 return tbl;
388} 382}
389 383
390static void __calgary_unmap_sg(struct iommu_table *tbl, 384static void calgary_unmap_sg(struct device *dev,
391 struct scatterlist *sglist, int nelems, int direction) 385 struct scatterlist *sglist, int nelems, int direction)
392{ 386{
387 struct iommu_table *tbl = find_iommu_table(dev);
388
389 if (!translate_phb(to_pci_dev(dev)))
390 return;
391
393 while (nelems--) { 392 while (nelems--) {
394 unsigned int npages; 393 unsigned int npages;
395 dma_addr_t dma = sglist->dma_address; 394 dma_addr_t dma = sglist->dma_address;
@@ -399,22 +398,11 @@ static void __calgary_unmap_sg(struct iommu_table *tbl,
399 break; 398 break;
400 399
401 npages = num_dma_pages(dma, dmalen); 400 npages = num_dma_pages(dma, dmalen);
402 __iommu_free(tbl, dma, npages); 401 iommu_free(tbl, dma, npages);
403 sglist++; 402 sglist++;
404 } 403 }
405} 404}
406 405
407void calgary_unmap_sg(struct device *dev, struct scatterlist *sglist,
408 int nelems, int direction)
409{
410 struct iommu_table *tbl = find_iommu_table(dev);
411
412 if (!translate_phb(to_pci_dev(dev)))
413 return;
414
415 __calgary_unmap_sg(tbl, sglist, nelems, direction);
416}
417
418static int calgary_nontranslate_map_sg(struct device* dev, 406static int calgary_nontranslate_map_sg(struct device* dev,
419 struct scatterlist *sg, int nelems, int direction) 407 struct scatterlist *sg, int nelems, int direction)
420{ 408{
@@ -466,7 +454,7 @@ static int calgary_map_sg(struct device *dev, struct scatterlist *sg,
466 454
467 return nelems; 455 return nelems;
468error: 456error:
469 __calgary_unmap_sg(tbl, sg, nelems, direction); 457 calgary_unmap_sg(dev, sg, nelems, direction);
470 for (i = 0; i < nelems; i++) { 458 for (i = 0; i < nelems; i++) {
471 sg[i].dma_address = bad_dma_address; 459 sg[i].dma_address = bad_dma_address;
472 sg[i].dma_length = 0; 460 sg[i].dma_length = 0;