Skip to contentSkip to conversation

arch: alpha: kernel: Use vma_pages()

PATCH New Shyam Saini 1 participant 1 message Oct 10, 2016 Alpha port

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arch: alpha: kernel: Use vma_pages()

Replace explicit computation of vma page count by a call to vma_pages()

---
 arch/alpha/kernel/pci-sysfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/alpha/kernel/pci-sysfs.c +2 -2
index 92c0d46..652449e 100644
@@ -38,7 +38,7 @@ static int __pci_mmap_fits(struct pci_dev *pdev, int num,
 	unsigned long nr, start, size;
 	int shift = sparse ? 5 : 0;
 
-	nr = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
+	nr = vma_pages(vma);
 	start = vma->vm_pgoff;
 	size = ((pci_resource_len(pdev, num) - 1) >> (PAGE_SHIFT - shift)) + 1;
 
@@ -255,7 +255,7 @@ static int __legacy_mmap_fits(struct pci_controller *hose,
 {
 	unsigned long nr, start, size;
 
-	nr = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
+	nr = vma_pages(vma);
 	start = vma->vm_pgoff;
 	size = ((res_size - 1) >> PAGE_SHIFT) + 1;
 
Signature · 1 line
2.7.4