make some functions and variables static
PATCH 1/6 make mips_nmi_setup() static
In reply to Dmitri VorobievThis change makes the needlessly global function mips_nmi_setup() static.
Successfully build-tested using default configs for Malta, Atlas and SEAD boards.
Runtime test successfully performed by booting the Malta 4Kc board up to the shell prompt.
--- arch/mips/mips-boards/generic/init.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/mips/mips-boards/generic/init.c +1 -1
@@ -226,7 +226,7 @@ void __init kgdb_config(void) }#endif -void __init mips_nmi_setup (void ) +static void __init mips_nmi_setup (void ) {void *base;extern char except_vec_nmi;
Signature · 1 line
1.5.3
PATCH 2/6 make mips_ejtag_setup() static
In reply to Dmitri VorobievThis change makes the needlessly global function mips_ejtag_setup() static.
Successfully build-tested using default configs for Malta, Atlas and SEAD boards.
Runtime test successfully performed by booting the Malta 4Kc board up to the shell prompt.
--- arch/mips/mips-boards/generic/init.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/mips/mips-boards/generic/init.c +1 -1
@@ -238,7 +238,7 @@ static void __init mips_nmi_setup(void)flush_icache_range ((unsigned long )base, (unsigned long )base +0x80 ); } -void __init mips_ejtag_setup (void ) +static void __init mips_ejtag_setup (void ) {void *base;extern char except_vec_ejtag_debug;
Signature · 1 line
1.5.3
cover make some functions and variables static
Hi Ralf,
I noticed that a few functions and variables in the MIPS-specific code can become static, and this series of patches cleans up the kernel global name space a little bit.
Please consider.
Thanks,
Dmitri Vorobiev
PATCH 6/6 malta_int.c: make 4 variables static
The following variables defined in arch/mips/mips-boards/malta/malta_int.c can become static: msc_irqmap[], msc_nr_irqs, msc_eicirqmap[], and msc_nr_eicirqs. This patch makes them static.
Successfully build-tested using default configs for Malta, Atlas and SEAD boards.
Runtime test successfully performed by booting the Malta 4Kc board up to the shell prompt.
--- arch/mips/mips-boards/malta/malta_int.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
arch/mips/mips-boards/malta/malta_int.c +4 -4
@@ -273,13 +273,13 @@ static struct irqaction corehi_irqaction = { .name = "CoreHi" }; -msc_irqmap_t __initdata msc_irqmap[] = { +static msc_irqmap_t __initdata msc_irqmap[] = { {MSC01C_INT_TMR ,MSC01_IRQ_EDGE ,0 }, {MSC01C_INT_PCI ,MSC01_IRQ_LEVEL ,0 }, }; -int __initdata msc_nr_irqs =ARRAY_SIZE (msc_irqmap); +static int __initdata msc_nr_irqs =ARRAY_SIZE (msc_irqmap); -msc_irqmap_t __initdata msc_eicirqmap[] = { +static msc_irqmap_t __initdata msc_eicirqmap[] = { {MSC01E_INT_SW0 ,MSC01_IRQ_LEVEL ,0 }, {MSC01E_INT_SW1 ,MSC01_IRQ_LEVEL ,0 }, {MSC01E_INT_I8259A ,MSC01_IRQ_LEVEL ,0 },
@@ -291,7 +291,7 @@ msc_irqmap_t __initdata msc_eicirqmap[] = { {MSC01E_INT_PERFCTR, MSC01_IRQ_LEVEL, 0}, {MSC01E_INT_CPUCTR, MSC01_IRQ_LEVEL, 0} }; -int __initdata msc_nr_eicirqs =ARRAY_SIZE (msc_eicirqmap); +static int __initdata msc_nr_eicirqs =ARRAY_SIZE (msc_eicirqmap);void __init arch_init_irq (void ) {
Signature · 1 line
1.5.3
PATCH 3/6 make mdesc and prom_getmdesc() static
In reply to Dmitri VorobievNeither the mdesc[] array nor the prom_getmdesc() function need to be global. This patch makes them static.
Successfully build-tested using default configs for Malta, Atlas and SEAD boards.
Runtime test successfully performed by booting the Malta 4Kc board up to the shell prompt.
--- arch/mips/mips-boards/generic/memory.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
arch/mips/mips-boards/generic/memory.c +2 -2
@@ -37,7 +37,7 @@ enum yamon_memtypes { yamon_prom, yamon_free, }; -struct prom_pmemblock mdesc[PROM_MAX_PMEMBLOCKS ]; +static struct prom_pmemblock mdesc[PROM_MAX_PMEMBLOCKS ];#ifdef DEBUG static char *mtypes[3] = {
@@ -50,7 +50,7 @@ static char *mtypes[3] = {/* determined physical memory size, not overridden by command line args */ unsigned long physical_memsize =0L ; -struct prom_pmemblock *__init prom_getmdesc (void ) +static struct prom_pmemblock *__init prom_getmdesc (void ) {char *memsize_str;unsigned int memsize;
Signature · 1 line
1.5.3
PATCH 4/6 make plat_perf_setup() static
In reply to Dmitri VorobievThere is no need for the plat_perf_setup() function to be global, so make it static.
Successfully build-tested using default configs for Malta, Atlas and SEAD boards.
Runtime test successfully performed by booting the Malta 4Kc board up to the shell prompt.
--- arch/mips/mips-boards/generic/time.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/mips/mips-boards/generic/time.c +1 -1
@@ -127,7 +127,7 @@ unsigned long read_persistent_clock(void)return mc146818_get_cmos_time (); } -void __init plat_perf_setup (void ) +static void __init plat_perf_setup (void ) { cp0_perfcount_irq =-1 ;
Signature · 1 line
1.5.3
PATCH 5/6 make standard_io_resources[] static
In reply to Dmitri VorobievThe array standard_io_resources[] needs not to be exposed in the kernel global namespace. This patch makes it static.
Successfully build-tested using default configs for Malta, Atlas and SEAD boards.
Runtime test successfully performed by booting the Malta 4Kc board up to the shell prompt.
--- arch/mips/mips-boards/malta/malta_setup.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
arch/mips/mips-boards/malta/malta_setup.c +2 -2
@@ -1,7 +1,7 @@/* * Carsten Langgaard, [email protected] * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved. -* Copyright (C) Dmitri Vorobiev +* Copyright (C) 2008 Dmitri Vorobiev * * This program is free software; you can distribute it and/or modify it * under the terms of the GNU General Public License (Version 2) as
@@ -36,7 +36,7 @@#include <linux/console.h> #endif -struct resource standard_io_resources[] = { +static struct resource standard_io_resources[] = { { .name ="dma1" , .start =0x00 ,
Signature · 1 line
1.5.3
Quoted 3 lines · Dmitri Vorobiev
I noticed that a few functions and variables in the MIPS-specific code can become static, and this series of patches cleans up the kernel global name space a little bit.
I've queued the whole series for 2.6.26.
Thanks,
Ralf
Ralf Baechle пишет:
Quoted 7 lines · Dmitri Vorobiev
Quoted 4 lines
I noticed that a few functions and variables in the MIPS-specific code can become static, and this series of patches cleans up the kernel global name space a little bit.
I've queued the whole series for 2.6.26.
Thank you, Ralf.
Dmitri
Quoted 5 lines
Thanks,
Ralf