summaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci-sysfs.c
diff options
context:
space:
mode:
authorLibin <huawei.libin@huawei.com>2013-04-15 04:48:54 +0200
committerBjorn Helgaas <bhelgaas@google.com>2013-04-15 22:30:44 +0200
commit64b001758e778b2b1aad08aa1f6c5896da5f5773 (patch)
tree5f2ee1a9ee6462696889908de3a5a5910b8a2ffb /drivers/pci/pci-sysfs.c
parentPCI: Use PCI_EXP_SLTCAP_PSN mask when extracting slot number (diff)
downloadlinux-64b001758e778b2b1aad08aa1f6c5896da5f5773.tar.xz
linux-64b001758e778b2b1aad08aa1f6c5896da5f5773.zip
PCI: Use vma_pages() to replace (vm_end - vm_start) >> PAGE_SHIFT
(*->vm_end - *->vm_start) >> PAGE_SHIFT operation is implemented as an inline funcion vma_pages() in linux/mm.h, so use it. Signed-off-by: Libin <huawei.libin@huawei.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/pci-sysfs.c')
-rw-r--r--drivers/pci/pci-sysfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
index 9c6e9bb674ec..5b4a9d9cd200 100644
--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -897,7 +897,7 @@ int pci_mmap_fits(struct pci_dev *pdev, int resno, struct vm_area_struct *vma,
if (pci_resource_len(pdev, resno) == 0)
return 0;
- nr = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
+ nr = vma_pages(vma);
start = vma->vm_pgoff;
size = ((pci_resource_len(pdev, resno) - 1) >> PAGE_SHIFT) + 1;
pci_start = (mmap_api == PCI_MMAP_PROCFS) ?