Skip to content

Commit a3ee8fa

Browse files
sravnborgdavem330
authored andcommitted
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>
1 parent 3731e19 commit a3ee8fa

5 files changed

Lines changed: 16 additions & 8 deletions

File tree

‎arch/sparc/include/asm/auxio.h‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
#ifndef ___ASM_SPARC_AUXIO_H
22
#define ___ASM_SPARC_AUXIO_H
3+
4+
#ifndef __ASSEMBLY__
5+
6+
extern void __iomem *auxio_register;
7+
8+
#endif /* ifndef __ASSEMBLY__ */
9+
310
#if defined(__sparc__) && defined(__arch64__)
411
#include <asm/auxio_64.h>
512
#else

‎arch/sparc/include/asm/auxio_64.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@
7575

7676
#ifndef __ASSEMBLY__
7777

78-
extern void __iomem *auxio_register;
79-
8078
#define AUXIO_LTE_ON 1
8179
#define AUXIO_LTE_OFF 0
8280

‎arch/sparc/kernel/auxio_32.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,15 @@
99
#include <linux/of.h>
1010
#include <linux/of_device.h>
1111
#include <linux/export.h>
12+
1213
#include <asm/oplib.h>
1314
#include <asm/io.h>
1415
#include <asm/auxio.h>
1516
#include <asm/string.h> /* memset(), Linux has no bzero() */
1617
#include <asm/cpu_type.h>
1718

19+
#include "kernel.h"
20+
1821
/* Probe and map in the Auxiliary I/O register */
1922

2023
/* auxio_register is not static because it is referenced

‎arch/sparc/kernel/devices.c‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,7 @@ void __init device_scan(void)
132132
}
133133
#endif /* !CONFIG_SMP */
134134

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();
141137
clock_stop_probe();
142138
}

‎arch/sparc/kernel/kernel.h‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,10 @@ void try_to_clear_window_buffer(struct pt_regs *regs, int who);
116116
/* tadpole.c */
117117
void __init clock_stop_probe(void);
118118

119+
/* auxio_32.c */
120+
void __init auxio_probe(void);
121+
void __init auxio_power_probe(void);
122+
119123
#else /* CONFIG_SPARC32 */
120124
#endif /* CONFIG_SPARC32 */
121125
#endif /* !(__SPARC_KERNEL_H) */

0 commit comments

Comments
 (0)