]> Pileus Git - ~andy/linux/blobdiff - arch/parisc/mm/ioremap.c
Merge branch 'pci/yinghai-hotplug-cleanup' into next
[~andy/linux] / arch / parisc / mm / ioremap.c
index 44b42c7f639d073b0339396a8ecd8d4c908f7340..838d0259cd2715e034ce7787eba12ac4cc7ae9c4 100644 (file)
@@ -26,7 +26,7 @@
  */
 void __iomem * __ioremap(unsigned long phys_addr, unsigned long size, unsigned long flags)
 {
-       void *addr;
+       void __iomem *addr;
        struct vm_struct *area;
        unsigned long offset, last_addr;
        pgprot_t pgprot;
@@ -71,7 +71,7 @@ void __iomem * __ioremap(unsigned long phys_addr, unsigned long size, unsigned l
         */
        offset = phys_addr & ~PAGE_MASK;
        phys_addr &= PAGE_MASK;
-       size = PAGE_ALIGN(last_addr) - phys_addr;
+       size = PAGE_ALIGN(last_addr + 1) - phys_addr;
 
        /*
         * Ok, go for it..
@@ -80,14 +80,14 @@ void __iomem * __ioremap(unsigned long phys_addr, unsigned long size, unsigned l
        if (!area)
                return NULL;
 
-       addr = area->addr;
+       addr = (void __iomem *) area->addr;
        if (ioremap_page_range((unsigned long)addr, (unsigned long)addr + size,
                               phys_addr, pgprot)) {
                vfree(addr);
                return NULL;
        }
 
-       return (void __iomem *) (offset + (char *)addr);
+       return (void __iomem *) (offset + (char __iomem *)addr);
 }
 EXPORT_SYMBOL(__ioremap);