lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1243586643-5554-10-git-send-email-ian.campbell@citrix.com>
Date:	Fri, 29 May 2009 09:44:03 +0100
From:	Ian Campbell <ian.campbell@...rix.com>
To:	<linux-kernel@...r.kernel.org>
CC:	Ian Campbell <ian.campbell@...rix.com>,
	FUJITA Tomonori <fujita.tomonori@....ntt.co.jp>,
	Jeremy Fitzhardinge <jeremy@...p.org>,
	Olaf Kirch <okir@...e.de>, Greg KH <gregkh@...e.de>,
	Ingo Molnar <mingo@...e.hu>
Subject: [PATCH 9/9] swiotlb: rename swiotlb_virt_to_bus as virt_to_dma

Rename swiotlb_virt_to_bus as swiotlb_virt_to_dma for consistency with
phys_to_dma.

Signed-off-by: Ian Campbell <ian.campbell@...rix.com>
Cc: FUJITA Tomonori <fujita.tomonori@....ntt.co.jp>
Cc: Jeremy Fitzhardinge <jeremy@...p.org>
Cc: Olaf Kirch <okir@...e.de>
Cc: Greg KH <gregkh@...e.de>
Cc: Ingo Molnar <mingo@...e.hu>
---
 lib/swiotlb.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/lib/swiotlb.c b/lib/swiotlb.c
index c50a5ed..8479ed9 100644
--- a/lib/swiotlb.c
+++ b/lib/swiotlb.c
@@ -124,14 +124,14 @@ void * __weak swiotlb_alloc(unsigned order, unsigned long nslabs)
 	return (void *)__get_free_pages(GFP_DMA | __GFP_NOWARN, order);
 }
 
-static dma_addr_t swiotlb_virt_to_bus(struct device *hwdev,
+static dma_addr_t swiotlb_virt_to_dma(struct device *hwdev,
 				      volatile void *address)
 {
 	return phys_to_dma(hwdev, virt_to_phys(address));
 }
 
 #ifdef CONFIG_HIGHMEM
-static void * swiotlb_bus_to_virt(struct device *hwdev, dma_addr_t address)
+static void * swiotlb_dma_to_virt(struct device *hwdev, dma_addr_t address)
 {
 	unsigned long pfn = PFN_DOWN(dma_to_phys(hwdev, addr));
 	void *pageaddr = page_address(pfn_to_page(pfn));
@@ -141,7 +141,7 @@ static void * swiotlb_bus_to_virt(struct device *hwdev, dma_addr_t address)
 	return NULL;
 }
 #else
-static void * swiotlb_bus_to_virt(struct device *hwdev, dma_addr_t address)
+static void * swiotlb_dma_to_virt(struct device *hwdev, dma_addr_t address)
 {
 	return phys_to_virt(dma_to_phys(hwdev, address));
 }
@@ -368,7 +368,7 @@ map_single(struct device *hwdev, phys_addr_t phys, size_t size, int dir)
 	unsigned long max_slots;
 
 	mask = dma_get_seg_boundary(hwdev);
-	start_dma_addr = swiotlb_virt_to_bus(hwdev, io_tlb_start) & mask;
+	start_dma_addr = swiotlb_virt_to_dma(hwdev, io_tlb_start) & mask;
 
 	offset_slots = ALIGN(start_dma_addr, 1 << IO_TLB_SHIFT) >> IO_TLB_SHIFT;
 
@@ -669,7 +669,7 @@ EXPORT_SYMBOL_GPL(swiotlb_map_page);
 static void unmap_single(struct device *hwdev, dma_addr_t dev_addr,
 			 size_t size, int dir)
 {
-	char *dma_addr = swiotlb_bus_to_virt(hwdev, dev_addr);
+	char *dma_addr = swiotlb_dma_to_virt(hwdev, dev_addr);
 
 	BUG_ON(dir == DMA_NONE);
 
@@ -706,7 +706,7 @@ static void
 swiotlb_sync_single(struct device *hwdev, dma_addr_t dev_addr,
 		    size_t size, int dir, int target)
 {
-	char *dma_addr = swiotlb_bus_to_virt(hwdev, dev_addr);
+	char *dma_addr = swiotlb_dma_to_virt(hwdev, dev_addr);
 
 	BUG_ON(dir == DMA_NONE);
 
@@ -893,19 +893,19 @@ EXPORT_SYMBOL(swiotlb_sync_sg_for_device);
 int
 swiotlb_dma_mapping_error(struct device *hwdev, dma_addr_t dma_addr)
 {
-	return (dma_addr == swiotlb_virt_to_bus(hwdev, io_tlb_overflow_buffer));
+	return (dma_addr == swiotlb_virt_to_dma(hwdev, io_tlb_overflow_buffer));
 }
 EXPORT_SYMBOL(swiotlb_dma_mapping_error);
 
 /*
  * Return whether the given device DMA address mask can be supported
  * properly.  For example, if your device can only drive the low 24-bits
- * during bus mastering, then you would pass 0x00ffffff as the mask to
+ * during dma mastering, then you would pass 0x00ffffff as the mask to
  * this function.
  */
 int
 swiotlb_dma_supported(struct device *hwdev, u64 mask)
 {
-	return swiotlb_virt_to_bus(hwdev, io_tlb_end - 1) <= mask;
+	return swiotlb_virt_to_dma(hwdev, io_tlb_end - 1) <= mask;
 }
 EXPORT_SYMBOL(swiotlb_dma_supported);
-- 
1.5.6.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ