sparc32: fix sparse warnings in setup_32.c
authorSam Ravnborg <sam@ravnborg.org>
Mon, 21 Apr 2014 19:39:28 +0000 (21:39 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 29 Apr 2014 05:12:25 +0000 (01:12 -0400)
Fix following warnings:
setup_32.c:106:15: warning: symbol 'cmdline_memory_size' was not declared. Should it be static?
setup_32.c:270:16: warning: symbol 'fake_swapper_regs' was not declared. Should it be static?
setup_32.c:368:55: warning: Using plain integer as NULL pointer

Add missing declaration of cmdline_memory_size and remove the local one in init_32.c
fake_swapper_regs was only used locally - so defined static.
When replacing 0 with NULL also add a few spaces around operators

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
arch/sparc/include/asm/setup.h
arch/sparc/kernel/setup_32.c
arch/sparc/mm/init_32.c

index 4b7465a8219ac0f77ef23b95ff64e840aaecb85b..c7cd435f919f3d0196dcfe88a2b01257d0d84102 100644 (file)
@@ -36,6 +36,9 @@ extern unsigned long pdma_areasize;
 
 int sparc_floppy_request_irq(unsigned int irq, irq_handler_t irq_handler);
 
+/* setup_32.c */
+extern unsigned long cmdline_memory_size;
+
 #endif
 
 extern void sun_do_break(void);
index 1434526970a6bf446a495d275eab9f46073a4172..baef495c06bdb081c0744a33f0e9564bd125a1eb 100644 (file)
@@ -267,7 +267,7 @@ static __init void leon_patch(void)
 }
 
 struct tt_entry *sparc_ttable;
-struct pt_regs fake_swapper_regs;
+static struct pt_regs fake_swapper_regs;
 
 /* Called from head_32.S - before we have setup anything
  * in the kernel. Be very careful with what you do here.
@@ -365,7 +365,7 @@ void __init setup_arch(char **cmdline_p)
 
        prom_setsync(prom_sync_me);
 
-       if((boot_flags&BOOTME_DEBUG) && (linux_dbvec!=0) && 
+       if((boot_flags & BOOTME_DEBUG) && (linux_dbvec != NULL) &&
           ((*(short *)linux_dbvec) != -1)) {
                printk("Booted under KADB. Syncing trap table.\n");
                (*(linux_dbvec->teach_debugger))();
index cf09e6e9e18d2588702e76ab47bb3f9f14604cd0..d0c732727f444a97f79c5179a6ef98cfe879958e 100644 (file)
@@ -31,6 +31,7 @@
 #include <asm/pgtable.h>
 #include <asm/vaddrs.h>
 #include <asm/pgalloc.h>       /* bug in asm-generic/tlb.h: check_pgt_cache */
+#include <asm/setup.h>
 #include <asm/tlb.h>
 #include <asm/prom.h>
 #include <asm/leon.h>
@@ -65,7 +66,6 @@ void show_mem(unsigned int filter)
 }
 
 
-extern unsigned long cmdline_memory_size;
 unsigned long last_valid_pfn;
 
 unsigned long calc_highpages(void)