diff options
author | Muhammad Falak R Wani <falakreyaz@gmail.com> | 2016-05-21 18:52:22 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-08-31 15:13:56 +0200 |
commit | 95da00e35acf92bb5d39f6f08267de0c1a5c8885 (patch) | |
tree | 32d7a3671623c2dda55f17febfcf1fdb2630955f /drivers/base/dma-mapping.c | |
parent | e688f144305c678fb65138d9e6b6ce436e59778b (diff) | |
download | talos-op-linux-95da00e35acf92bb5d39f6f08267de0c1a5c8885.tar.gz talos-op-linux-95da00e35acf92bb5d39f6f08267de0c1a5c8885.zip |
dma-mapping: use vma_pages().
Replace explicit computation of vma page count by a call to
vma_pages()
Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base/dma-mapping.c')
-rw-r--r-- | drivers/base/dma-mapping.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/base/dma-mapping.c b/drivers/base/dma-mapping.c index 261420ddfe66..2e318ffa019e 100644 --- a/drivers/base/dma-mapping.c +++ b/drivers/base/dma-mapping.c @@ -247,7 +247,7 @@ int dma_common_mmap(struct device *dev, struct vm_area_struct *vma, { int ret = -ENXIO; #if defined(CONFIG_MMU) && !defined(CONFIG_ARCH_NO_COHERENT_DMA_MMAP) - unsigned long user_count = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; + unsigned long user_count = vma_pages(vma); unsigned long count = PAGE_ALIGN(size) >> PAGE_SHIFT; unsigned long pfn = page_to_pfn(virt_to_page(cpu_addr)); unsigned long off = vma->vm_pgoff; |