Skip to content

Commit c61c65c

Browse files
AdrianBunkdavem330
authored andcommitted
sparc/kernel/: possible cleanups
This patch contains the following possible cleanups: - make the following needlessly global code static: - apc.c: apc_swift_idle() - ebus.c: ebus_blacklist_irq() - ebus.c: fill_ebus_child() - ebus.c: fill_ebus_device() - entry.S: syscall_is_too_hard - etra: tsetup_sun4c_stackchk - head.S: cputyp - head.S: prom_vector_p - idprom.c: Sun_Machines[] - ioport.c: _sparc_find_resource() - ioport.c: create_proc_read_entry() - irq.c: struct sparc_irq[] - rtrap.S: sun4c_rett_stackchk - setup.c: prom_sync_me() - setup.c: boot_flags - sun4c_irq.c: sun4c_sbint_to_irq() - sun4d_irq.c: sbus_tid[] - sun4d_irq.c: struct sbus_actions - sun4d_irq.c: sun4d_sbint_to_irq() - sun4m_irq.c: sun4m_sbint_to_irq() - sun4m_irq.c: sun4m_get_irqmask() - sun4m_irq.c: sun4m_timers - sun4m_smp.c: smp4m_cross_call() - sun4m_smp.c: smp4m_blackbox_id() - sun4m_smp.c: smp4m_blackbox_current() - time.c: sp_clock_typ - time.c: sbus_time_init() - traps.c: instruction_dump() - wof.S: spwin_sun4c_stackchk - wuf.S: sun4c_fwin_stackchk - #if 0 the following unused code: - process.c: sparc_backtrace_lock - process.c: __show_backtrace() - process.c: show_backtrace() - process.c: smp_show_backtrace_all_cpus() - remove the following unused code: - entry.S: __handle_exception - smp.c: smp_num_cpus - smp.c: smp_activated - smp.c: __cpu_number_map[] - smp.c: __cpu_logical_map[] - smp.c: bitops_spinlock - traps.c: trap_curbuf - traps.c: trapbuf[] - traps.c: linux_smp_still_initting - traps.c: thiscpus_tbr - traps.c: thiscpus_mid Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 5b664cb commit c61c65c

23 files changed

Lines changed: 38 additions & 60 deletions

‎arch/sparc/kernel/apc.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ __setup("apc=", apc_setup);
5656
* CPU idle callback function
5757
* See .../arch/sparc/kernel/process.c
5858
*/
59-
void apc_swift_idle(void)
59+
static void apc_swift_idle(void)
6060
{
6161
#ifdef APC_DEBUG_LED
6262
set_auxio(0x00, AUXIO_LED);

‎arch/sparc/kernel/ebus.c‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ static inline unsigned long ebus_alloc(size_t size)
6969

7070
/*
7171
*/
72-
int __init ebus_blacklist_irq(const char *name)
72+
static int __init ebus_blacklist_irq(const char *name)
7373
{
7474
struct ebus_device_irq *dp;
7575

@@ -83,8 +83,8 @@ int __init ebus_blacklist_irq(const char *name)
8383
return 0;
8484
}
8585

86-
void __init fill_ebus_child(struct device_node *dp,
87-
struct linux_ebus_child *dev)
86+
static void __init fill_ebus_child(struct device_node *dp,
87+
struct linux_ebus_child *dev)
8888
{
8989
const int *regs;
9090
const int *irqs;
@@ -144,7 +144,8 @@ void __init fill_ebus_child(struct device_node *dp,
144144
}
145145
}
146146

147-
void __init fill_ebus_device(struct device_node *dp, struct linux_ebus_device *dev)
147+
static void __init fill_ebus_device(struct device_node *dp,
148+
struct linux_ebus_device *dev)
148149
{
149150
const struct linux_prom_registers *regs;
150151
struct linux_ebus_child *child;

‎arch/sparc/kernel/entry.S‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1317,7 +1317,6 @@ linux_sparc_syscall:
13171317
bne linux_fast_syscall
13181318
/* Just do first insn from SAVE_ALL in the delay slot */
13191319

1320-
.globl syscall_is_too_hard
13211320
syscall_is_too_hard:
13221321
SAVE_ALL_HEAD
13231322
rd %wim, %l3
@@ -1544,8 +1543,7 @@ kgdb_trap_low:
15441543
#endif
15451544

15461545
.align 4
1547-
.globl __handle_exception, flush_patch_exception
1548-
__handle_exception:
1546+
.globl flush_patch_exception
15491547
flush_patch_exception:
15501548
FLUSH_ALL_KERNEL_WINDOWS;
15511549
ldd [%o0], %o6

‎arch/sparc/kernel/etrap.S‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,6 @@ tsetup_mmu_patchme:
228228
*/
229229
#define glob_tmp g1
230230

231-
.globl tsetup_sun4c_stackchk
232231
tsetup_sun4c_stackchk:
233232
/* Done by caller: andcc %sp, 0x7, %g0 */
234233
bne trap_setup_user_stack_is_bolixed

‎arch/sparc/kernel/head.S‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
*/
3333

3434
.align 4
35-
.globl cputyp
3635
cputyp:
3736
.word 1
3837

@@ -1280,7 +1279,6 @@ halt_me:
12801279
* gets initialized in c-code so all routines can use it.
12811280
*/
12821281

1283-
.globl prom_vector_p
12841282
prom_vector_p:
12851283
.word 0
12861284

‎arch/sparc/kernel/idprom.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ static struct idprom idprom_buffer;
2424
* of the Sparc CPU and have a meaningful IDPROM machtype value that we
2525
* know about. See asm-sparc/machines.h for empirical constants.
2626
*/
27-
struct Sun_Machine_Models Sun_Machines[NUM_SUN_MACHINES] = {
27+
static struct Sun_Machine_Models Sun_Machines[NUM_SUN_MACHINES] = {
2828
/* First, Sun4's */
2929
{ "Sun 4/100 Series", (SM_SUN4 | SM_4_110) },
3030
{ "Sun 4/200 Series", (SM_SUN4 | SM_4_260) },

‎arch/sparc/kernel/ioport.c‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,16 @@
4949

5050
#define mmu_inval_dma_area(p, l) /* Anton pulled it out for 2.4.0-xx */
5151

52-
struct resource *_sparc_find_resource(struct resource *r, unsigned long);
52+
static struct resource *_sparc_find_resource(struct resource *r,
53+
unsigned long);
5354

5455
static void __iomem *_sparc_ioremap(struct resource *res, u32 bus, u32 pa, int sz);
5556
static void __iomem *_sparc_alloc_io(unsigned int busno, unsigned long phys,
5657
unsigned long size, char *name);
5758
static void _sparc_free_io(struct resource *res);
5859

60+
static void register_proc_sparc_ioport(void);
61+
5962
/* This points to the next to use virtual memory for DVMA mappings */
6063
static struct resource _sparc_dvma = {
6164
.name = "sparc_dvma", .start = DVMA_VADDR, .end = DVMA_END - 1
@@ -539,8 +542,6 @@ void __init sbus_setup_arch_props(struct sbus_bus *sbus, struct device_node *dp)
539542

540543
int __init sbus_arch_preinit(void)
541544
{
542-
extern void register_proc_sparc_ioport(void);
543-
544545
register_proc_sparc_ioport();
545546

546547
#ifdef CONFIG_SUN4
@@ -853,8 +854,8 @@ _sparc_io_get_info(char *buf, char **start, off_t fpos, int length, int *eof,
853854
* XXX Too slow. Can have 8192 DVMA pages on sun4m in the worst case.
854855
* This probably warrants some sort of hashing.
855856
*/
856-
struct resource *
857-
_sparc_find_resource(struct resource *root, unsigned long hit)
857+
static struct resource *_sparc_find_resource(struct resource *root,
858+
unsigned long hit)
858859
{
859860
struct resource *tmp;
860861

@@ -865,7 +866,7 @@ _sparc_find_resource(struct resource *root, unsigned long hit)
865866
return NULL;
866867
}
867868

868-
void register_proc_sparc_ioport(void)
869+
static void register_proc_sparc_ioport(void)
869870
{
870871
#ifdef CONFIG_PROC_FS
871872
create_proc_read_entry("io_map",0,NULL,_sparc_io_get_info,&sparc_iomap);

‎arch/sparc/kernel/irq.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ void (*sparc_init_timers)(irq_handler_t ) =
154154
struct irqaction static_irqaction[MAX_STATIC_ALLOC];
155155
int static_irq_count;
156156

157-
struct {
157+
static struct {
158158
struct irqaction *action;
159159
int flags;
160160
} sparc_irq[NR_IRQS];

‎arch/sparc/kernel/process.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,8 @@ void machine_power_off(void)
177177
machine_halt();
178178
}
179179

180+
#if 0
181+
180182
static DEFINE_SPINLOCK(sparc_backtrace_lock);
181183

182184
void __show_backtrace(unsigned long fp)
@@ -228,7 +230,6 @@ void smp_show_backtrace_all_cpus(void)
228230
}
229231
#endif
230232

231-
#if 0
232233
void show_stackframe(struct sparc_stackf *sf)
233234
{
234235
unsigned long size;

‎arch/sparc/kernel/rtrap.S‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,6 @@ ret_trap_user_stack_is_bolixed:
224224
b signal_p
225225
ld [%curptr + TI_FLAGS], %g2
226226

227-
228-
.globl sun4c_rett_stackchk
229227
sun4c_rett_stackchk:
230228
be 1f
231229
and %fp, 0xfff, %g1 ! delay slot

0 commit comments

Comments
 (0)