Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6d78b5f9c6cf59c98d3833e09d0ed6aebd6a33d3
Commit:     6d78b5f9c6cf59c98d3833e09d0ed6aebd6a33d3
Parent:     4486b86368d72bcac76439638b36667b1c6a1360
Author:     Russell King <[EMAIL PROTECTED]>
AuthorDate: Sun Jun 3 19:26:04 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 11:13:33 2007 +0100

    [ARM] Fix bounding error in ioremap_pfn()
    
    If size=16M offset=2K then we should map two supersections
    rather than just one.
    
    Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/mm/ioremap.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
index f3ade18..7595277 100644
--- a/arch/arm/mm/ioremap.c
+++ b/arch/arm/mm/ioremap.c
@@ -280,7 +280,10 @@ __arm_ioremap_pfn(unsigned long pfn, unsigned long offset, 
size_t size,
        if (!type)
                return NULL;
 
-       size = PAGE_ALIGN(size);
+       /*
+        * Page align the mapping size, taking account of any offset.
+        */
+       size = PAGE_ALIGN(offset + size);
 
        area = get_vm_area(size, VM_IOREMAP);
        if (!area)
@@ -325,11 +328,6 @@ __arm_ioremap(unsigned long phys_addr, size_t size, 
unsigned int mtype)
        if (!size || last_addr < phys_addr)
                return NULL;
 
-       /*
-        * Page align the mapping size
-        */
-       size = PAGE_ALIGN(last_addr + 1) - phys_addr;
-
        return __arm_ioremap_pfn(pfn, offset, size, mtype);
 }
 EXPORT_SYMBOL(__arm_ioremap);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to