summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2009-07-10 05:04:52 +0400
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2009-07-28 09:19:18 +0400
commitcf56e3f2e8a8d5b7bc719980869b0e7985c256f3 (patch)
tree36b594be25cf278243bd79ed932f2362ff71afef /lib
parentbb52196be37ce154ddc50b1f39496146d181cbe7 (diff)
downloadlinux-cf56e3f2e8a8d5b7bc719980869b0e7985c256f3.tar.xz
swiotlb: remove swiotlb_arch_range_needs_mapping
Nobody uses swiotlb_arch_range_needs_mapping(). Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Acked-by: Becky Bruce <beckyb@kernel.crashing.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/swiotlb.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/lib/swiotlb.c b/lib/swiotlb.c
index 3c4c21cdf43d..dc1cd1f5369e 100644
--- a/lib/swiotlb.c
+++ b/lib/swiotlb.c
@@ -141,11 +141,6 @@ int __weak swiotlb_arch_address_needs_mapping(struct device *hwdev,
return !is_buffer_dma_capable(dma_get_mask(hwdev), addr, size);
}
-int __weak swiotlb_arch_range_needs_mapping(phys_addr_t paddr, size_t size)
-{
- return 0;
-}
-
static void swiotlb_print_info(unsigned long bytes)
{
phys_addr_t pstart, pend;
@@ -312,11 +307,6 @@ address_needs_mapping(struct device *hwdev, dma_addr_t addr, size_t size)
return swiotlb_arch_address_needs_mapping(hwdev, addr, size);
}
-static inline int range_needs_mapping(phys_addr_t paddr, size_t size)
-{
- return swiotlb_force || swiotlb_arch_range_needs_mapping(paddr, size);
-}
-
static int is_swiotlb_buffer(char *addr)
{
return addr >= io_tlb_start && addr < io_tlb_end;
@@ -646,8 +636,7 @@ dma_addr_t swiotlb_map_page(struct device *dev, struct page *page,
* we can safely return the device addr and not worry about bounce
* buffering it.
*/
- if (!address_needs_mapping(dev, dev_addr, size) &&
- !range_needs_mapping(phys, size))
+ if (!address_needs_mapping(dev, dev_addr, size) && !swiotlb_force)
return dev_addr;
/*
@@ -810,7 +799,7 @@ swiotlb_map_sg_attrs(struct device *hwdev, struct scatterlist *sgl, int nelems,
phys_addr_t paddr = sg_phys(sg);
dma_addr_t dev_addr = swiotlb_phys_to_bus(hwdev, paddr);
- if (range_needs_mapping(paddr, sg->length) ||
+ if (swiotlb_force ||
address_needs_mapping(hwdev, dev_addr, sg->length)) {
void *map = map_single(hwdev, sg_phys(sg),
sg->length, dir);