public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] [MIPS] sparse noise reduction and namespace cleanups
@ 2008-05-29 14:57 Dmitri Vorobiev
  2008-05-29 14:57 ` [PATCH 1/5] [MIPS] fix sparse warning about setup_early_printk() Dmitri Vorobiev
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Dmitri Vorobiev @ 2008-05-29 14:57 UTC (permalink / raw)
  To: linux-mips, ralf, linux-kernel

Hi Ralf,

Please consider a new series of cleanup patches.

Thanks,
Dmitri Vorobiev

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/5] [MIPS] fix sparse warning about setup_early_printk()
  2008-05-29 14:57 [PATCH 0/5] [MIPS] sparse noise reduction and namespace cleanups Dmitri Vorobiev
@ 2008-05-29 14:57 ` Dmitri Vorobiev
  2008-05-29 14:57 ` [PATCH 2/5] [MIPS] Make two functions static Dmitri Vorobiev
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Dmitri Vorobiev @ 2008-05-29 14:57 UTC (permalink / raw)
  To: linux-mips, ralf, linux-kernel

This patch fixes the following sparse warning:

<<<<<<<<

arch/mips/kernel/early_printk.c:35:13: warning: symbol 'setup_early_printk'
was not declared. Should it be static?

<<<<<<<<

The fix is to define a prototype of the setup_early_printk() function and
to include the appropriate header into arch/mips/kernel/early_printk.c.

Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@movial.fi>
---
 arch/mips/kernel/early_printk.c |    1 +
 arch/mips/kernel/setup.c        |    6 +-----
 include/asm-mips/setup.h        |    2 ++
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/arch/mips/kernel/early_printk.c b/arch/mips/kernel/early_printk.c
index 9dccfa4..cb602c1 100644
--- a/arch/mips/kernel/early_printk.c
+++ b/arch/mips/kernel/early_printk.c
@@ -7,6 +7,7 @@
  * Copyright (C) 2007 MIPS Technologies, Inc.
  *   written by Ralf Baechle (ralf@linux-mips.org)
  */
+#include <asm/setup.h>
 #include <linux/console.h>
 #include <linux/init.h>
 
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index c6a063b..0370794 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -557,11 +557,7 @@ void __init setup_arch(char **cmdline_p)
 	prom_init();
 
 #ifdef CONFIG_EARLY_PRINTK
-	{
-		extern void setup_early_printk(void);
-
-		setup_early_printk();
-	}
+	setup_early_printk();
 #endif
 	cpu_report();
 	check_bugs_early();
diff --git a/include/asm-mips/setup.h b/include/asm-mips/setup.h
index 70009a9..883f59b 100644
--- a/include/asm-mips/setup.h
+++ b/include/asm-mips/setup.h
@@ -3,4 +3,6 @@
 
 #define COMMAND_LINE_SIZE	256
 
+extern void setup_early_printk(void);
+
 #endif /* __SETUP_H */
-- 
1.4.4.3


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/5] [MIPS] Make two functions static
  2008-05-29 14:57 [PATCH 0/5] [MIPS] sparse noise reduction and namespace cleanups Dmitri Vorobiev
  2008-05-29 14:57 ` [PATCH 1/5] [MIPS] fix sparse warning about setup_early_printk() Dmitri Vorobiev
@ 2008-05-29 14:57 ` Dmitri Vorobiev
  2008-05-29 14:57 ` [PATCH 3/5] [MIPS] remove unused function alloc_legacy_irqno() Dmitri Vorobiev
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Dmitri Vorobiev @ 2008-05-29 14:57 UTC (permalink / raw)
  To: linux-mips, ralf, linux-kernel

The following routines

uasm_rel_highest()
uasm_rel_higher()

are needlessly defined global. This patch makes them static.

Compile-tested using a customized config for the Malta board. Booting
the same board up to the shell prompt was also successful with this
patch applied.

Spotted by sparse.

Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@movial.fi>
---
 arch/mips/mm/uasm.c |    4 ++--
 arch/mips/mm/uasm.h |    2 --
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/mips/mm/uasm.c b/arch/mips/mm/uasm.c
index 1655aa6..f467199 100644
--- a/arch/mips/mm/uasm.c
+++ b/arch/mips/mm/uasm.c
@@ -396,7 +396,7 @@ int __cpuinit uasm_in_compat_space_p(long addr)
 #endif
 }
 
-int __cpuinit uasm_rel_highest(long val)
+static int __cpuinit uasm_rel_highest(long val)
 {
 #ifdef CONFIG_64BIT
 	return ((((val + 0x800080008000L) >> 48) & 0xffff) ^ 0x8000) - 0x8000;
@@ -405,7 +405,7 @@ int __cpuinit uasm_rel_highest(long val)
 #endif
 }
 
-int __cpuinit uasm_rel_higher(long val)
+static int __cpuinit uasm_rel_higher(long val)
 {
 #ifdef CONFIG_64BIT
 	return ((((val + 0x80008000L) >> 32) & 0xffff) ^ 0x8000) - 0x8000;
diff --git a/arch/mips/mm/uasm.h b/arch/mips/mm/uasm.h
index 0d6a66f..c6d1e3d 100644
--- a/arch/mips/mm/uasm.h
+++ b/arch/mips/mm/uasm.h
@@ -103,8 +103,6 @@ struct uasm_label {
 void __cpuinit uasm_build_label(struct uasm_label **lab, u32 *addr, int lid);
 #ifdef CONFIG_64BIT
 int uasm_in_compat_space_p(long addr);
-int uasm_rel_highest(long val);
-int uasm_rel_higher(long val);
 #endif
 int uasm_rel_hi(long val);
 int uasm_rel_lo(long val);
-- 
1.4.4.3


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3/5] [MIPS] remove unused function alloc_legacy_irqno()
  2008-05-29 14:57 [PATCH 0/5] [MIPS] sparse noise reduction and namespace cleanups Dmitri Vorobiev
  2008-05-29 14:57 ` [PATCH 1/5] [MIPS] fix sparse warning about setup_early_printk() Dmitri Vorobiev
  2008-05-29 14:57 ` [PATCH 2/5] [MIPS] Make two functions static Dmitri Vorobiev
@ 2008-05-29 14:57 ` Dmitri Vorobiev
  2008-05-29 14:57 ` [PATCH 4/5] [MIPS] unexport {allocate,free}_irqno Dmitri Vorobiev
  2008-05-29 14:57 ` [PATCH 5/5] [MIPS] The tickcount per-cpu variable can become static Dmitri Vorobiev
  4 siblings, 0 replies; 8+ messages in thread
From: Dmitri Vorobiev @ 2008-05-29 14:57 UTC (permalink / raw)
  To: linux-mips, ralf, linux-kernel

The function alloc_legacy_irqno() is not used any more, and this
patch removes it.

Inspired by a namespacecheck warning.

Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@movial.fi>
---
 arch/mips/kernel/irq.c |   13 -------------
 include/asm-mips/irq.h |    1 -
 2 files changed, 0 insertions(+), 14 deletions(-)

diff --git a/arch/mips/kernel/irq.c b/arch/mips/kernel/irq.c
index e3309ff..ba4e331 100644
--- a/arch/mips/kernel/irq.c
+++ b/arch/mips/kernel/irq.c
@@ -46,19 +46,6 @@ again:
 
 EXPORT_SYMBOL_GPL(allocate_irqno);
 
-/*
- * Allocate the 16 legacy interrupts for i8259 devices.  This happens early
- * in the kernel initialization so treating allocation failure as BUG() is
- * ok.
- */
-void __init alloc_legacy_irqno(void)
-{
-	int i;
-
-	for (i = 0; i <= 16; i++)
-		BUG_ON(test_and_set_bit(i, irq_map));
-}
-
 void free_irqno(unsigned int irq)
 {
 	smp_mb__before_clear_bit();
diff --git a/include/asm-mips/irq.h b/include/asm-mips/irq.h
index a58f0ee..08e0700 100644
--- a/include/asm-mips/irq.h
+++ b/include/asm-mips/irq.h
@@ -148,7 +148,6 @@ extern void arch_init_irq(void);
 extern void spurious_interrupt(void);
 
 extern int allocate_irqno(void);
-extern void alloc_legacy_irqno(void);
 extern void free_irqno(unsigned int irq);
 
 /*
-- 
1.4.4.3


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 4/5] [MIPS] unexport {allocate,free}_irqno
  2008-05-29 14:57 [PATCH 0/5] [MIPS] sparse noise reduction and namespace cleanups Dmitri Vorobiev
                   ` (2 preceding siblings ...)
  2008-05-29 14:57 ` [PATCH 3/5] [MIPS] remove unused function alloc_legacy_irqno() Dmitri Vorobiev
@ 2008-05-29 14:57 ` Dmitri Vorobiev
  2008-05-29 14:57 ` [PATCH 5/5] [MIPS] The tickcount per-cpu variable can become static Dmitri Vorobiev
  4 siblings, 0 replies; 8+ messages in thread
From: Dmitri Vorobiev @ 2008-05-29 14:57 UTC (permalink / raw)
  To: linux-mips, ralf, linux-kernel

The following routines

allocate_irqno()
free_irqno()

seem not to be used outside of the core kernel code, hence
exporting these functions is pointless. This patch removes
the export.

Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@movial.fi>
---
 arch/mips/kernel/irq.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/arch/mips/kernel/irq.c b/arch/mips/kernel/irq.c
index ba4e331..ffd80de 100644
--- a/arch/mips/kernel/irq.c
+++ b/arch/mips/kernel/irq.c
@@ -44,8 +44,6 @@ again:
 	return irq;
 }
 
-EXPORT_SYMBOL_GPL(allocate_irqno);
-
 void free_irqno(unsigned int irq)
 {
 	smp_mb__before_clear_bit();
@@ -53,8 +51,6 @@ void free_irqno(unsigned int irq)
 	smp_mb__after_clear_bit();
 }
 
-EXPORT_SYMBOL_GPL(free_irqno);
-
 /*
  * 'what should we do if we get a hw irq event on an illegal vector'.
  * each architecture has to answer this themselves.
-- 
1.4.4.3


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 5/5] [MIPS] The tickcount per-cpu variable can become static
  2008-05-29 14:57 [PATCH 0/5] [MIPS] sparse noise reduction and namespace cleanups Dmitri Vorobiev
                   ` (3 preceding siblings ...)
  2008-05-29 14:57 ` [PATCH 4/5] [MIPS] unexport {allocate,free}_irqno Dmitri Vorobiev
@ 2008-05-29 14:57 ` Dmitri Vorobiev
  2008-05-30  7:58   ` Dmitri Vorobiev
  2008-06-11 17:44   ` Ralf Baechle
  4 siblings, 2 replies; 8+ messages in thread
From: Dmitri Vorobiev @ 2008-05-29 14:57 UTC (permalink / raw)
  To: linux-mips, ralf, linux-kernel

In arch/mips/mips-boards/generic/time.c, the `tickcount' per-cpu
variable is needlessly defined global, and this patch makes it
static.

Noticed by sparse. Tested by booting a Qemu-emulated Malta board
up to the shell prompt.

Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@movial.fi>
---
 arch/mips/mips-boards/generic/time.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/mips/mips-boards/generic/time.c b/arch/mips/mips-boards/generic/time.c
index 008fd82..585fb44 100644
--- a/arch/mips/mips-boards/generic/time.c
+++ b/arch/mips/mips-boards/generic/time.c
@@ -58,7 +58,7 @@ static int mips_cpu_timer_irq;
 static int mips_cpu_perf_irq;
 extern int cp0_perfcount_irq;
 
-DEFINE_PER_CPU(unsigned int, tickcount);
+static DEFINE_PER_CPU(unsigned int, tickcount);
 #define tickcount_this_cpu __get_cpu_var(tickcount)
 static unsigned long ledbitmask;
 
-- 
1.4.4.3


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 5/5] [MIPS] The tickcount per-cpu variable can become static
  2008-05-29 14:57 ` [PATCH 5/5] [MIPS] The tickcount per-cpu variable can become static Dmitri Vorobiev
@ 2008-05-30  7:58   ` Dmitri Vorobiev
  2008-06-11 17:44   ` Ralf Baechle
  1 sibling, 0 replies; 8+ messages in thread
From: Dmitri Vorobiev @ 2008-05-30  7:58 UTC (permalink / raw)
  To: Dmitri Vorobiev; +Cc: linux-mips, ralf, linux-kernel

Dmitri Vorobiev wrote:
> In arch/mips/mips-boards/generic/time.c, the `tickcount' per-cpu
> variable is needlessly defined global, and this patch makes it
> static.
> 
> Noticed by sparse. Tested by booting a Qemu-emulated Malta board
> up to the shell prompt.
> 
> Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@movial.fi>

Ouch, it seems that this one does not apply to the latest linux-mips 
git. I usually base my patches on Linus' tree. Please drop.

Dmitri


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 5/5] [MIPS] The tickcount per-cpu variable can become static
  2008-05-29 14:57 ` [PATCH 5/5] [MIPS] The tickcount per-cpu variable can become static Dmitri Vorobiev
  2008-05-30  7:58   ` Dmitri Vorobiev
@ 2008-06-11 17:44   ` Ralf Baechle
  1 sibling, 0 replies; 8+ messages in thread
From: Ralf Baechle @ 2008-06-11 17:44 UTC (permalink / raw)
  To: Dmitri Vorobiev; +Cc: linux-mips, linux-kernel

On Thu, May 29, 2008 at 05:57:12PM +0300, Dmitri Vorobiev wrote:

> In arch/mips/mips-boards/generic/time.c, the `tickcount' per-cpu
> variable is needlessly defined global, and this patch makes it
> static.
> 
> Noticed by sparse. Tested by booting a Qemu-emulated Malta board
> up to the shell prompt.

Patch is ok - except it tries to fix a piece of code which I've already
removed so I'll drop this one.

  Ralf

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2008-06-11 17:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-29 14:57 [PATCH 0/5] [MIPS] sparse noise reduction and namespace cleanups Dmitri Vorobiev
2008-05-29 14:57 ` [PATCH 1/5] [MIPS] fix sparse warning about setup_early_printk() Dmitri Vorobiev
2008-05-29 14:57 ` [PATCH 2/5] [MIPS] Make two functions static Dmitri Vorobiev
2008-05-29 14:57 ` [PATCH 3/5] [MIPS] remove unused function alloc_legacy_irqno() Dmitri Vorobiev
2008-05-29 14:57 ` [PATCH 4/5] [MIPS] unexport {allocate,free}_irqno Dmitri Vorobiev
2008-05-29 14:57 ` [PATCH 5/5] [MIPS] The tickcount per-cpu variable can become static Dmitri Vorobiev
2008-05-30  7:58   ` Dmitri Vorobiev
2008-06-11 17:44   ` Ralf Baechle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox