diff options
Diffstat (limited to 'arch/sparc')
-rw-r--r-- | arch/sparc/include/asm/elf_64.h | 2 | ||||
-rw-r--r-- | arch/sparc/kernel/ioport.c | 12 | ||||
-rw-r--r-- | arch/sparc/kernel/pci.c | 6 |
3 files changed, 9 insertions, 11 deletions
diff --git a/arch/sparc/include/asm/elf_64.h b/arch/sparc/include/asm/elf_64.h index e67880381b84..cfa9cd2e5519 100644 --- a/arch/sparc/include/asm/elf_64.h +++ b/arch/sparc/include/asm/elf_64.h | |||
@@ -186,7 +186,7 @@ static inline unsigned int sparc64_elf_hwcap(void) | |||
186 | return cap; | 186 | return cap; |
187 | } | 187 | } |
188 | 188 | ||
189 | #define ELF_HWCAP sparc64_elf_hwcap(); | 189 | #define ELF_HWCAP sparc64_elf_hwcap() |
190 | 190 | ||
191 | /* This yields a string that ld.so will use to load implementation | 191 | /* This yields a string that ld.so will use to load implementation |
192 | specific libraries for optimization. This is more specific in | 192 | specific libraries for optimization. This is more specific in |
diff --git a/arch/sparc/kernel/ioport.c b/arch/sparc/kernel/ioport.c index 1c9c80a1a86a..6ffccd6e0156 100644 --- a/arch/sparc/kernel/ioport.c +++ b/arch/sparc/kernel/ioport.c | |||
@@ -228,7 +228,7 @@ _sparc_ioremap(struct resource *res, u32 bus, u32 pa, int sz) | |||
228 | } | 228 | } |
229 | 229 | ||
230 | pa &= PAGE_MASK; | 230 | pa &= PAGE_MASK; |
231 | sparc_mapiorange(bus, pa, res->start, res->end - res->start + 1); | 231 | sparc_mapiorange(bus, pa, res->start, resource_size(res)); |
232 | 232 | ||
233 | return (void __iomem *)(unsigned long)(res->start + offset); | 233 | return (void __iomem *)(unsigned long)(res->start + offset); |
234 | } | 234 | } |
@@ -240,7 +240,7 @@ static void _sparc_free_io(struct resource *res) | |||
240 | { | 240 | { |
241 | unsigned long plen; | 241 | unsigned long plen; |
242 | 242 | ||
243 | plen = res->end - res->start + 1; | 243 | plen = resource_size(res); |
244 | BUG_ON((plen & (PAGE_SIZE-1)) != 0); | 244 | BUG_ON((plen & (PAGE_SIZE-1)) != 0); |
245 | sparc_unmapiorange(res->start, plen); | 245 | sparc_unmapiorange(res->start, plen); |
246 | release_resource(res); | 246 | release_resource(res); |
@@ -331,9 +331,9 @@ static void sbus_free_coherent(struct device *dev, size_t n, void *p, | |||
331 | } | 331 | } |
332 | 332 | ||
333 | n = PAGE_ALIGN(n); | 333 | n = PAGE_ALIGN(n); |
334 | if ((res->end-res->start)+1 != n) { | 334 | if (resource_size(res) != n) { |
335 | printk("sbus_free_consistent: region 0x%lx asked 0x%zx\n", | 335 | printk("sbus_free_consistent: region 0x%lx asked 0x%zx\n", |
336 | (long)((res->end-res->start)+1), n); | 336 | (long)resource_size(res), n); |
337 | return; | 337 | return; |
338 | } | 338 | } |
339 | 339 | ||
@@ -504,9 +504,9 @@ static void pci32_free_coherent(struct device *dev, size_t n, void *p, | |||
504 | } | 504 | } |
505 | 505 | ||
506 | n = PAGE_ALIGN(n); | 506 | n = PAGE_ALIGN(n); |
507 | if ((res->end-res->start)+1 != n) { | 507 | if (resource_size(res) != n) { |
508 | printk("pci_free_consistent: region 0x%lx asked 0x%lx\n", | 508 | printk("pci_free_consistent: region 0x%lx asked 0x%lx\n", |
509 | (long)((res->end-res->start)+1), (long)n); | 509 | (long)resource_size(res), (long)n); |
510 | return; | 510 | return; |
511 | } | 511 | } |
512 | 512 | ||
diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c index 80a87e2a3e7c..1e94f946570e 100644 --- a/arch/sparc/kernel/pci.c +++ b/arch/sparc/kernel/pci.c | |||
@@ -820,11 +820,9 @@ static int __pci_mmap_make_offset_bus(struct pci_dev *pdev, struct vm_area_struc | |||
820 | unsigned long space_size, user_offset, user_size; | 820 | unsigned long space_size, user_offset, user_size; |
821 | 821 | ||
822 | if (mmap_state == pci_mmap_io) { | 822 | if (mmap_state == pci_mmap_io) { |
823 | space_size = (pbm->io_space.end - | 823 | space_size = resource_size(&pbm->io_space); |
824 | pbm->io_space.start) + 1; | ||
825 | } else { | 824 | } else { |
826 | space_size = (pbm->mem_space.end - | 825 | space_size = resource_size(&pbm->mem_space); |
827 | pbm->mem_space.start) + 1; | ||
828 | } | 826 | } |
829 | 827 | ||
830 | /* Make sure the request is in range. */ | 828 | /* Make sure the request is in range. */ |