Skip to contentSkip to conversation

make some functions and variables static

PATCH In review Dmitri Vorobiev 2 participants 9 messages Mar 31, 2008 – Apr 1, 2008 MIPS

lore
Share & tools
lore
#1 lore raw

PATCH 1/6 make mips_nmi_setup() static

In reply to Dmitri Vorobiev

This 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
index 1695dca..70dd9f4 100644
@@ -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
#2 lore raw

PATCH 2/6 make mips_ejtag_setup() static

In reply to Dmitri Vorobiev

This 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
index 70dd9f4..80e5504 100644
@@ -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
#0 lore raw

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

#6 lore raw

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
index dbe60eb..b51a70b 100644
@@ -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
#3 lore raw

PATCH 3/6 make mdesc and prom_getmdesc() static

In reply to Dmitri Vorobiev

Neither 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
index dc272c1..5e443bb 100644
@@ -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
#4 lore raw

PATCH 4/6 make plat_perf_setup() static

In reply to Dmitri Vorobiev

There 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
index b50e0fc..a6eece7 100644
@@ -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
#5 lore raw

PATCH 5/6 make standard_io_resources[] static

In reply to Dmitri Vorobiev

The 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
index 2cd8f57..a06e4b5 100644
@@ -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
#7 lore raw
In reply to Dmitri Vorobiev
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

#8 lore raw

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