diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-11-10 03:16:27 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-11-10 03:16:27 -0500 |
commit | 4ecd33d930591d41fe356160593a9076467b961c (patch) | |
tree | b9051a334540bbce38db1b2b03cebb4cf1d51f73 /arch/sparc64/kernel/pci.c | |
parent | 7d5a78cd98c3a5eb83bd6a061c5ea6ef1e9b8fcb (diff) | |
parent | f7160c7573615ec82c691e294cf80d920b5d588d (diff) |
Merge commit 'v2.6.28-rc4' into x86/apic
Diffstat (limited to 'arch/sparc64/kernel/pci.c')
-rw-r--r-- | arch/sparc64/kernel/pci.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/arch/sparc64/kernel/pci.c b/arch/sparc64/kernel/pci.c index 242ac1ccae7d..bdb7c0a6d83d 100644 --- a/arch/sparc64/kernel/pci.c +++ b/arch/sparc64/kernel/pci.c | |||
@@ -889,6 +889,7 @@ static int __pci_mmap_make_offset(struct pci_dev *pdev, | |||
889 | 889 | ||
890 | for (i = 0; i <= PCI_ROM_RESOURCE; i++) { | 890 | for (i = 0; i <= PCI_ROM_RESOURCE; i++) { |
891 | struct resource *rp = &pdev->resource[i]; | 891 | struct resource *rp = &pdev->resource[i]; |
892 | resource_size_t aligned_end; | ||
892 | 893 | ||
893 | /* Active? */ | 894 | /* Active? */ |
894 | if (!rp->flags) | 895 | if (!rp->flags) |
@@ -906,8 +907,15 @@ static int __pci_mmap_make_offset(struct pci_dev *pdev, | |||
906 | continue; | 907 | continue; |
907 | } | 908 | } |
908 | 909 | ||
910 | /* Align the resource end to the next page address. | ||
911 | * PAGE_SIZE intentionally added instead of (PAGE_SIZE - 1), | ||
912 | * because actually we need the address of the next byte | ||
913 | * after rp->end. | ||
914 | */ | ||
915 | aligned_end = (rp->end + PAGE_SIZE) & PAGE_MASK; | ||
916 | |||
909 | if ((rp->start <= user_paddr) && | 917 | if ((rp->start <= user_paddr) && |
910 | (user_paddr + user_size) <= (rp->end + 1UL)) | 918 | (user_paddr + user_size) <= aligned_end) |
911 | break; | 919 | break; |
912 | } | 920 | } |
913 | 921 | ||