Commit 236d62b0 authored by Shyam Saini's avatar Shyam Saini Committed by Matt Turner

alpha: kernel: Use vma_pages()

Replace explicit computation of vma page count by a call to
vma_pages()
Signed-off-by: default avatarShyam Saini <mayhs11saini@gmail.com>
Signed-off-by: default avatarMatt Turner <mattst88@gmail.com>
parent 03e1f044
...@@ -38,7 +38,7 @@ static int __pci_mmap_fits(struct pci_dev *pdev, int num, ...@@ -38,7 +38,7 @@ static int __pci_mmap_fits(struct pci_dev *pdev, int num,
unsigned long nr, start, size; unsigned long nr, start, size;
int shift = sparse ? 5 : 0; int shift = sparse ? 5 : 0;
nr = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; nr = vma_pages(vma);
start = vma->vm_pgoff; start = vma->vm_pgoff;
size = ((pci_resource_len(pdev, num) - 1) >> (PAGE_SHIFT - shift)) + 1; size = ((pci_resource_len(pdev, num) - 1) >> (PAGE_SHIFT - shift)) + 1;
...@@ -255,7 +255,7 @@ static int __legacy_mmap_fits(struct pci_controller *hose, ...@@ -255,7 +255,7 @@ static int __legacy_mmap_fits(struct pci_controller *hose,
{ {
unsigned long nr, start, size; unsigned long nr, start, size;
nr = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; nr = vma_pages(vma);
start = vma->vm_pgoff; start = vma->vm_pgoff;
size = ((res_size - 1) >> PAGE_SHIFT) + 1; size = ((res_size - 1) >> PAGE_SHIFT) + 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment