summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorGeliang Tang <geliangtang@gmail.com>2017-04-22 09:18:05 +0800
committerVinod Koul <vinod.koul@intel.com>2017-04-24 18:40:04 +0530
commite57d05520f9c89cf7616fc8c65dafb1ceb7a4c63 (patch)
treeb02d50f421b79ebc7f33aedd09f663e083924f88 /lib
parentb70e52cacb3bff1cc6fae36a89e0fa9d33fe31a7 (diff)
downloadlinux-stable-e57d05520f9c89cf7616fc8c65dafb1ceb7a4c63.tar.gz
linux-stable-e57d05520f9c89cf7616fc8c65dafb1ceb7a4c63.tar.bz2
linux-stable-e57d05520f9c89cf7616fc8c65dafb1ceb7a4c63.zip
dma-debug: use offset_in_page() macro
Use offset_in_page() macro instead of open-coding. Signed-off-by: Geliang Tang <geliangtang@gmail.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/dma-debug.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/dma-debug.c b/lib/dma-debug.c
index b157b46cc9a6..cd5a5a426ef1 100644
--- a/lib/dma-debug.c
+++ b/lib/dma-debug.c
@@ -1502,7 +1502,7 @@ void debug_dma_alloc_coherent(struct device *dev, size_t size,
entry->type = dma_debug_coherent;
entry->dev = dev;
entry->pfn = page_to_pfn(virt_to_page(virt));
- entry->offset = (size_t) virt & ~PAGE_MASK;
+ entry->offset = offset_in_page(virt);
entry->size = size;
entry->dev_addr = dma_addr;
entry->direction = DMA_BIDIRECTIONAL;
@@ -1518,7 +1518,7 @@ void debug_dma_free_coherent(struct device *dev, size_t size,
.type = dma_debug_coherent,
.dev = dev,
.pfn = page_to_pfn(virt_to_page(virt)),
- .offset = (size_t) virt & ~PAGE_MASK,
+ .offset = offset_in_page(virt),
.dev_addr = addr,
.size = size,
.direction = DMA_BIDIRECTIONAL,