summaryrefslogtreecommitdiffstats
path: root/include/linux/dma-mapping.h
diff options
context:
space:
mode:
authorGeliang Tang <geliangtang@163.com>2016-01-20 15:02:12 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2016-01-20 17:09:18 -0800
commit8e99469ab0f821bea77625cd4775ca529d4ca7d4 (patch)
tree13afb3717afb0d0ed1f007a32f87abd6bc4d81ce /include/linux/dma-mapping.h
parent20d666e41166f8023ff3d960e832d87ded18c5c4 (diff)
downloadblackbird-op-linux-8e99469ab0f821bea77625cd4775ca529d4ca7d4.tar.gz
blackbird-op-linux-8e99469ab0f821bea77625cd4775ca529d4ca7d4.zip
dma-mapping: use offset_in_page macro
Use offset_in_page macro instead of (addr & ~PAGE_MASK). Signed-off-by: Geliang Tang <geliangtang@163.com> Acked-by: Will Deacon <will.deacon@arm.com> Cc: Christian Borntraeger <borntraeger@de.ibm.com> Cc: Joerg Roedel <jroedel@suse.de> Cc: Sebastian Ott <sebott@linux.vnet.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/dma-mapping.h')
-rw-r--r--include/linux/dma-mapping.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index d6b575bb45a7..75857cda38e9 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -129,10 +129,10 @@ static inline dma_addr_t dma_map_single_attrs(struct device *dev, void *ptr,
kmemcheck_mark_initialized(ptr, size);
BUG_ON(!valid_dma_direction(dir));
addr = ops->map_page(dev, virt_to_page(ptr),
- (unsigned long)ptr & ~PAGE_MASK, size,
+ offset_in_page(ptr), size,
dir, attrs);
debug_dma_map_page(dev, virt_to_page(ptr),
- (unsigned long)ptr & ~PAGE_MASK, size,
+ offset_in_page(ptr), size,
dir, addr, true);
return addr;
}
OpenPOWER on IntegriCloud