]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
x86: start annotating early ioremap pointers with __iomem
authorHarvey Harrison <harvey.harrison@gmail.com>
Wed, 29 Oct 2008 05:46:04 +0000 (22:46 -0700)
committerIngo Molnar <mingo@elte.hu>
Wed, 29 Oct 2008 07:05:14 +0000 (08:05 +0100)
Impact: some new sparse warnings in e820.c etc, but no functional change.

As with regular ioremap, iounmap etc, annotate with __iomem.

Fixes the following sparse warnings, will produce some new ones
elsewhere in arch/x86 that will get worked out over time.

arch/x86/mm/ioremap.c:402:9: warning: cast removes address space of expression
arch/x86/mm/ioremap.c:406:10: warning: cast adds address space to expression (<asn:2>)
arch/x86/mm/ioremap.c:782:19: warning: Using plain integer as NULL pointer

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/include/asm/io.h
arch/x86/mm/ioremap.c

index 5618a103f395c1bf16558b57115ef1c4ae976392..ac2abc88cd95fa3e9049acc0440d65d59cd47ac1 100644 (file)
@@ -82,9 +82,9 @@ extern void __iomem *ioremap_wc(unsigned long offset, unsigned long size);
 extern void early_ioremap_init(void);
 extern void early_ioremap_clear(void);
 extern void early_ioremap_reset(void);
-extern void *early_ioremap(unsigned long offset, unsigned long size);
-extern void *early_memremap(unsigned long offset, unsigned long size);
-extern void early_iounmap(void *addr, unsigned long size);
+extern void __iomem *early_ioremap(unsigned long offset, unsigned long size);
+extern void __iomem *early_memremap(unsigned long offset, unsigned long size);
+extern void early_iounmap(void __iomem *addr, unsigned long size);
 extern void __iomem *fix_ioremap(unsigned idx, unsigned long phys);
 
 
index ae71e11eb3e5e4ddeceadc9128d3afea564f27e0..d4c4307ff3e049f1454c3629fb2989f63395ae68 100644 (file)
@@ -387,7 +387,7 @@ static void __iomem *ioremap_default(resource_size_t phys_addr,
                                        unsigned long size)
 {
        unsigned long flags;
-       void *ret;
+       void __iomem *ret;
        int err;
 
        /*
@@ -399,11 +399,11 @@ static void __iomem *ioremap_default(resource_size_t phys_addr,
        if (err < 0)
                return NULL;
 
-       ret = (void *) __ioremap_caller(phys_addr, size, flags,
-                                       __builtin_return_address(0));
+       ret = __ioremap_caller(phys_addr, size, flags,
+                              __builtin_return_address(0));
 
        free_memtype(phys_addr, phys_addr + size);
-       return (void __iomem *)ret;
+       return ret;
 }
 
 void __iomem *ioremap_prot(resource_size_t phys_addr, unsigned long size,
@@ -622,7 +622,7 @@ static inline void __init early_clear_fixmap(enum fixed_addresses idx)
                __early_set_fixmap(idx, 0, __pgprot(0));
 }
 
-static void *prev_map[FIX_BTMAPS_SLOTS] __initdata;
+static void __iomem *prev_map[FIX_BTMAPS_SLOTS] __initdata;
 static unsigned long prev_size[FIX_BTMAPS_SLOTS] __initdata;
 static int __init check_early_ioremap_leak(void)
 {
@@ -645,7 +645,7 @@ static int __init check_early_ioremap_leak(void)
 }
 late_initcall(check_early_ioremap_leak);
 
-static void __init *__early_ioremap(unsigned long phys_addr, unsigned long size, pgprot_t prot)
+static void __init __iomem *__early_ioremap(unsigned long phys_addr, unsigned long size, pgprot_t prot)
 {
        unsigned long offset, last_addr;
        unsigned int nrpages;
@@ -713,23 +713,23 @@ static void __init *__early_ioremap(unsigned long phys_addr, unsigned long size,
        if (early_ioremap_debug)
                printk(KERN_CONT "%08lx + %08lx\n", offset, fix_to_virt(idx0));
 
-       prev_map[slot] = (void *) (offset + fix_to_virt(idx0));
+       prev_map[slot] = (void __iomem *)(offset + fix_to_virt(idx0));
        return prev_map[slot];
 }
 
 /* Remap an IO device */
-void __init *early_ioremap(unsigned long phys_addr, unsigned long size)
+void __init __iomem *early_ioremap(unsigned long phys_addr, unsigned long size)
 {
        return __early_ioremap(phys_addr, size, PAGE_KERNEL_IO);
 }
 
 /* Remap memory */
-void __init *early_memremap(unsigned long phys_addr, unsigned long size)
+void __init __iomem *early_memremap(unsigned long phys_addr, unsigned long size)
 {
        return __early_ioremap(phys_addr, size, PAGE_KERNEL);
 }
 
-void __init early_iounmap(void *addr, unsigned long size)
+void __init early_iounmap(void __iomem *addr, unsigned long size)
 {
        unsigned long virt_addr;
        unsigned long offset;
@@ -779,7 +779,7 @@ void __init early_iounmap(void *addr, unsigned long size)
                --idx;
                --nrpages;
        }
-       prev_map[slot] = 0;
+       prev_map[slot] = NULL;
 }
 
 void __this_fixmap_does_not_exist(void)