Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sparc32: fix sparse warnings in auxio_32.c

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>

authored by

Sam Ravnborg and committed by
David S. Miller
a3ee8faa 3731e199

+16 -8
+7
arch/sparc/include/asm/auxio.h
··· 1 1 #ifndef ___ASM_SPARC_AUXIO_H 2 2 #define ___ASM_SPARC_AUXIO_H 3 + 4 + #ifndef __ASSEMBLY__ 5 + 6 + extern void __iomem *auxio_register; 7 + 8 + #endif /* ifndef __ASSEMBLY__ */ 9 + 3 10 #if defined(__sparc__) && defined(__arch64__) 4 11 #include <asm/auxio_64.h> 5 12 #else
-2
arch/sparc/include/asm/auxio_64.h
··· 75 75 76 76 #ifndef __ASSEMBLY__ 77 77 78 - extern void __iomem *auxio_register; 79 - 80 78 #define AUXIO_LTE_ON 1 81 79 #define AUXIO_LTE_OFF 0 82 80
+3
arch/sparc/kernel/auxio_32.c
··· 9 9 #include <linux/of.h> 10 10 #include <linux/of_device.h> 11 11 #include <linux/export.h> 12 + 12 13 #include <asm/oplib.h> 13 14 #include <asm/io.h> 14 15 #include <asm/auxio.h> 15 16 #include <asm/string.h> /* memset(), Linux has no bzero() */ 16 17 #include <asm/cpu_type.h> 18 + 19 + #include "kernel.h" 17 20 18 21 /* Probe and map in the Auxiliary I/O register */ 19 22
+2 -6
arch/sparc/kernel/devices.c
··· 132 132 } 133 133 #endif /* !CONFIG_SMP */ 134 134 135 - { 136 - extern void auxio_probe(void); 137 - extern void auxio_power_probe(void); 138 - auxio_probe(); 139 - auxio_power_probe(); 140 - } 135 + auxio_probe(); 136 + auxio_power_probe(); 141 137 clock_stop_probe(); 142 138 }
+4
arch/sparc/kernel/kernel.h
··· 116 116 /* tadpole.c */ 117 117 void __init clock_stop_probe(void); 118 118 119 + /* auxio_32.c */ 120 + void __init auxio_probe(void); 121 + void __init auxio_power_probe(void); 122 + 119 123 #else /* CONFIG_SPARC32 */ 120 124 #endif /* CONFIG_SPARC32 */ 121 125 #endif /* !(__SPARC_KERNEL_H) */