[ARM] sparse: fix several warnings
authorRussell King <rmk@dyn-67.arm.linux.org.uk>
Fri, 5 Sep 2008 13:08:44 +0000 (14:08 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Fri, 5 Sep 2008 13:11:24 +0000 (14:11 +0100)
arch/arm/kernel/process.c:270:6: warning: symbol 'show_fpregs' was not declared. Should it be static?

This function isn't used, so can be removed.

arch/arm/kernel/setup.c:532:9: warning: symbol 'len' shadows an earlier one
arch/arm/kernel/setup.c:524:6: originally declared here

A function containing two 'len's.

arch/arm/mm/fault-armv.c:188:13: warning: symbol 'check_writebuffer_bugs' was not declared. Should it be static?
arch/arm/mm/mmap.c:122:5: warning: symbol 'valid_phys_addr_range' was not declared. Should it be static?
arch/arm/mm/mmap.c:137:5: warning: symbol 'valid_mmap_phys_addr_range' was not declared. Should it be static?

Missing includes.

arch/arm/kernel/traps.c:71:77: warning: Using plain integer as NULL pointer
arch/arm/mm/ioremap.c:355:46: error: incompatible types in comparison expression (different address spaces)

Sillies.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/kernel/process.c
arch/arm/kernel/setup.c
arch/arm/kernel/traps.c
arch/arm/mm/fault-armv.c
arch/arm/mm/ioremap.c
arch/arm/mm/mmap.c

index 3fd88233706413d09198bb6a69780415a9b5eb5e..a2e75420858ecf118f40074bfca350d3495f2fa1 100644 (file)
@@ -267,35 +267,6 @@ void show_regs(struct pt_regs * regs)
        __backtrace();
 }
 
-void show_fpregs(struct user_fp *regs)
-{
-       int i;
-
-       for (i = 0; i < 8; i++) {
-               unsigned long *p;
-               char type;
-
-               p = (unsigned long *)(regs->fpregs + i);
-
-               switch (regs->ftype[i]) {
-                       case 1: type = 'f'; break;
-                       case 2: type = 'd'; break;
-                       case 3: type = 'e'; break;
-                       default: type = '?'; break;
-               }
-               if (regs->init_flag)
-                       type = '?';
-
-               printk("  f%d(%c): %08lx %08lx %08lx%c",
-                       i, type, p[0], p[1], p[2], i & 1 ? '\n' : ' ');
-       }
-                       
-
-       printk("FPSR: %08lx FPCR: %08lx\n",
-               (unsigned long)regs->fpsr,
-               (unsigned long)regs->fpcr);
-}
-
 /*
  * Free current thread data structures etc..
  */
index e90422d374af35516bd5a6eb49d3ac2b373476af..67d20e9a745196dd416d17a41d0e41f0e69ba170 100644 (file)
@@ -529,12 +529,12 @@ static void __init parse_cmdline(char **cmdline_p, char *from)
                        struct early_params *p;
 
                        for (p = &__early_begin; p < &__early_end; p++) {
-                               int len = strlen(p->arg);
+                               int arglen = strlen(p->arg);
 
-                               if (memcmp(from, p->arg, len) == 0) {
+                               if (memcmp(from, p->arg, arglen) == 0) {
                                        if (to != command_line)
                                                to -= 1;
-                                       from += len;
+                                       from += arglen;
                                        p->fn(&from);
 
                                        while (*from != ' ' && *from != '\0')
index 46e2c8315a3399cf171954d69f92ae9d463cc350..13f8f1860f752c5472d365ca6627ba63ce45d5c1 100644 (file)
@@ -68,7 +68,8 @@ void dump_backtrace_entry(unsigned long where, unsigned long from, unsigned long
  */
 static int verify_stack(unsigned long sp)
 {
-       if (sp < PAGE_OFFSET || (sp > (unsigned long)high_memory && high_memory != 0))
+       if (sp < PAGE_OFFSET ||
+           (sp > (unsigned long)high_memory && high_memory != NULL))
                return -EFAULT;
 
        return 0;
index dbdb7b72f2c132d70e2cdfc90e28bcc973d929a2..af6ed6ef9a81d3aeb654fccd8f3cf72ad9b8ab4f 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/init.h>
 #include <linux/pagemap.h>
 
+#include <asm/bugs.h>
 #include <asm/cacheflush.h>
 #include <asm/cachetype.h>
 #include <asm/pgtable.h>
index 20e4454e452eee0d481fb1f1588fc7d481f4cdac..52e5a4d28eb70c76e0684414db644f25c0322e73 100644 (file)
@@ -333,15 +333,14 @@ __arm_ioremap(unsigned long phys_addr, size_t size, unsigned int mtype)
 }
 EXPORT_SYMBOL(__arm_ioremap);
 
-void __iounmap(volatile void __iomem *addr)
+void __iounmap(volatile void __iomem *io_addr)
 {
+       void *addr = (void *)(PAGE_MASK & (unsigned long)io_addr);
 #ifndef CONFIG_SMP
        struct vm_struct **p, *tmp;
 #endif
        unsigned int section_mapping = 0;
 
-       addr = (volatile void __iomem *)(PAGE_MASK & (unsigned long)addr);
-
 #ifndef CONFIG_SMP
        /*
         * If this is a section based mapping we need to handle it
@@ -352,7 +351,7 @@ void __iounmap(volatile void __iomem *addr)
         */
        write_lock(&vmlist_lock);
        for (p = &vmlist ; (tmp = *p) ; p = &tmp->next) {
-               if((tmp->flags & VM_IOREMAP) && (tmp->addr == addr)) {
+               if ((tmp->flags & VM_IOREMAP) && (tmp->addr == addr)) {
                        if (tmp->flags & VM_ARM_SECTION_MAPPING) {
                                *p = tmp->next;
                                unmap_area_sections((unsigned long)tmp->addr,
@@ -367,6 +366,6 @@ void __iounmap(volatile void __iomem *addr)
 #endif
 
        if (!section_mapping)
-               vunmap((void __force *)addr);
+               vunmap(addr);
 }
 EXPORT_SYMBOL(__iounmap);
index 28ead8393b5ac30594a023fe102ec19fabfceeb9..5358fcc7f61ef8a112834fd839162a438df5ff22 100644 (file)
@@ -6,6 +6,7 @@
 #include <linux/mman.h>
 #include <linux/shm.h>
 #include <linux/sched.h>
+#include <linux/io.h>
 #include <asm/cputype.h>
 #include <asm/system.h>