x86: ioremap(), extend check to all RAM pages
authorIngo Molnar <mingo@elte.hu>
Thu, 28 Feb 2008 13:10:49 +0000 (14:10 +0100)
committerIngo Molnar <mingo@elte.hu>
Thu, 17 Apr 2008 15:40:51 +0000 (17:40 +0200)
Suggested by Jan Beulich.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Acked-by: Jan Beulich <jbeulich@novell.com>
arch/x86/mm/ioremap.c

index 17f5188390285f7aca36a27e2befc113bfd8bdff..e5608d380176e4bf0e0a3b3f1d0286094641593d 100644 (file)
@@ -146,8 +146,9 @@ static void __iomem *__ioremap(resource_size_t phys_addr, unsigned long size,
        /*
         * Don't allow anybody to remap normal RAM that we're using..
         */
        /*
         * Don't allow anybody to remap normal RAM that we're using..
         */
-       for (pfn = phys_addr >> PAGE_SHIFT; pfn < max_pfn_mapped &&
-            (pfn << PAGE_SHIFT) < last_addr; pfn++) {
+       for (pfn = phys_addr >> PAGE_SHIFT;
+                               (pfn << PAGE_SHIFT) < last_addr; pfn++) {
+
                if (page_is_ram(pfn) && pfn_valid(pfn) &&
                    !PageReserved(pfn_to_page(pfn)))
                        return NULL;
                if (page_is_ram(pfn) && pfn_valid(pfn) &&
                    !PageReserved(pfn_to_page(pfn)))
                        return NULL;