]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
sparc32: fix sparse warnings in auxio_32.c
authorSam Ravnborg <sam@ravnborg.org>
Mon, 21 Apr 2014 19:39:35 +0000 (21:39 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 29 Apr 2014 05:12:26 +0000 (01:12 -0400)
Fix following warnings:
auxio_32.c:23:14: warning: symbol 'auxio_register' was not declared. Should it be static?
auxio_32.c:26:13: warning: symbol 'auxio_probe' was not declared. Should it be static?
auxio_32.c:108:13: warning: symbol 'auxio_power_probe' was not declared. Should it be static?

Add proper decalarations for the above.

The leaves one sparse warning:
auxio_32.c:130:33: warning: cast removes address space of expression

This is here:
    auxio_power_register = (unsigned char *) of_ioremap()

This is __iomem that is removed from return value of of_ioremap()
The pointer is later used without any helpers in process_32.c:
    *auxio_power_register |= AUXIO_POWER_OFF;

It would be simple to introduce a few sbus() helpers.
But as I was not sure this was correct the warning are left as-is.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
arch/sparc/include/asm/auxio.h
arch/sparc/include/asm/auxio_64.h
arch/sparc/kernel/auxio_32.c
arch/sparc/kernel/devices.c
arch/sparc/kernel/kernel.h

index 13dc67f03011eae7624c26957cf4f6a5085a4c34..3e09a07b77e9132adb3dbcdc906270453df0f3dd 100644 (file)
@@ -1,5 +1,12 @@
 #ifndef ___ASM_SPARC_AUXIO_H
 #define ___ASM_SPARC_AUXIO_H
+
+#ifndef __ASSEMBLY__
+
+extern void __iomem *auxio_register;
+
+#endif /* ifndef __ASSEMBLY__ */
+
 #if defined(__sparc__) && defined(__arch64__)
 #include <asm/auxio_64.h>
 #else
index f61cd1e3e3957c18ae12129b41e353060cac9f89..7af9766a1c35d46aa887fc9742b0c39f33ae76b3 100644 (file)
@@ -75,8 +75,6 @@
 
 #ifndef __ASSEMBLY__
 
-extern void __iomem *auxio_register;
-
 #define AUXIO_LTE_ON   1
 #define AUXIO_LTE_OFF  0
 
index e20cc55fb768f3eab1de428cb7e03930b0adf4b0..c6fc1d451407ce1abf022128b0bcd71735a2ffc9 100644 (file)
@@ -9,12 +9,15 @@
 #include <linux/of.h>
 #include <linux/of_device.h>
 #include <linux/export.h>
+
 #include <asm/oplib.h>
 #include <asm/io.h>
 #include <asm/auxio.h>
 #include <asm/string.h>                /* memset(), Linux has no bzero() */
 #include <asm/cpu_type.h>
 
+#include "kernel.h"
+
 /* Probe and map in the Auxiliary I/O register */
 
 /* auxio_register is not static because it is referenced 
index 086faf6e5c38212b4a84b381e236d343b4193bcb..6f39916dc6e8697149a7206721d21ec4b27c98ac 100644 (file)
@@ -132,11 +132,7 @@ void __init device_scan(void)
        }
 #endif /* !CONFIG_SMP */
 
-       {
-               extern void auxio_probe(void);
-               extern void auxio_power_probe(void);
-               auxio_probe();
-               auxio_power_probe();
-       }
+       auxio_probe();
+       auxio_power_probe();
        clock_stop_probe();
 }
index 487762612224015a5386f20e054eb304bfa9fb9d..716158a5795050d46e9df1d2ed21ce6ac22282d8 100644 (file)
@@ -116,6 +116,10 @@ void try_to_clear_window_buffer(struct pt_regs *regs, int who);
 /* tadpole.c */
 void __init clock_stop_probe(void);
 
+/* auxio_32.c */
+void __init auxio_probe(void);
+void __init auxio_power_probe(void);
+
 #else /* CONFIG_SPARC32 */
 #endif /* CONFIG_SPARC32 */
 #endif /* !(__SPARC_KERNEL_H) */