Re: [PATCH] [12/45] i386: Fix arch/i386/kernel/nmi.c - 'unknown_nmi_panic_callback' declared 'static' but never defined warning

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Andi Kleen <ak@...>
Cc: <patches@...>, <linux-kernel@...>
Date: Friday, September 21, 2007 - 5:08 pm

On Fri, Sep 21, 2007 at 10:44:53PM +0200, Andi Kleen wrote:
 > 
 > I get this warning when CONFIG_SYSCTL is not set :
 > 
 > ...
 > 
 > arch/i386/kernel/nmi.c:52: warning: 'unknown_nmi_panic_callback' declared 'static' but never defined

If you move the function call after the declaration, you can do without
both the prototype, and the ifdef.

Signed-off-by: Dave Jones <davej@redhat.com>

diff --git a/arch/i386/kernel/nmi.c b/arch/i386/kernel/nmi.c
index c7227e2..9a8ff0b 100644
--- a/arch/i386/kernel/nmi.c
+++ b/arch/i386/kernel/nmi.c
@@ -48,9 +48,6 @@ static unsigned int nmi_hz = HZ;
 
 static DEFINE_PER_CPU(short, wd_enabled);
 
-/* local prototypes */
-static int unknown_nmi_panic_callback(struct pt_regs *regs, int cpu);
-
 static int endflag __initdata = 0;
 
 #ifdef CONFIG_SMP
@@ -389,15 +386,6 @@ __kprobes int nmi_watchdog_tick(struct pt_regs * regs, unsigned reason)
 	return rc;
 }
 
-int do_nmi_callback(struct pt_regs * regs, int cpu)
-{
-#ifdef CONFIG_SYSCTL
-	if (unknown_nmi_panic)
-		return unknown_nmi_panic_callback(regs, cpu);
-#endif
-	return 0;
-}
-
 #ifdef CONFIG_SYSCTL
 
 static int unknown_nmi_panic_callback(struct pt_regs *regs, int cpu)
@@ -451,6 +439,16 @@ int proc_nmi_enabled(struct ctl_table *table, int write, struct file *file,
 
 #endif
 
+int do_nmi_callback(struct pt_regs * regs, int cpu)
+{
+#ifdef CONFIG_SYSCTL
+	if (unknown_nmi_panic)
+		return unknown_nmi_panic_callback(regs, cpu);
+#endif
+	return 0;
+}
+
+
 void __trigger_all_cpu_backtrace(void)
 {
 	int i;

-- 
http://www.codemonkey.org.uk
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] [0/45] x86 2.6.24 patches review I, Andi Kleen, (Fri Sep 21, 4:44 pm)
[PATCH] [41/45] i386: remove unnecessary code, Andi Kleen, (Fri Sep 21, 4:45 pm)
[PATCH] [35/45] i386: make some variables static, Andi Kleen, (Fri Sep 21, 4:45 pm)
[PATCH] [33/45] i386: es7000 minor cleanups, Andi Kleen, (Fri Sep 21, 4:45 pm)
Re: [PATCH] [32/45] x86_64: hide cond_syscall behind __KERNE..., Christoph Hellwig, (Sat Sep 22, 5:30 am)
[PATCH] [31/45] i386: make struct apic_probe static, Andi Kleen, (Fri Sep 21, 4:45 pm)
[PATCH] [25/45] x86_64: remove sync_Arb_IDs, Andi Kleen, (Fri Sep 21, 4:45 pm)
Re: [PATCH] [24/45] x86: Introduce frame_pointer() and stack..., Christoph Hellwig, (Sat Sep 22, 5:26 am)
Re: [PATCH] [12/45] i386: Fix arch/i386/kernel/nmi.c - 'unkn..., Dave Jones, (Fri Sep 21, 5:08 pm)
[PATCH] [4/45] i386: Rewrite sched_clock, Andi Kleen, (Fri Sep 21, 4:44 pm)
[PATCH] [2/45] x86: constify stacktrace_ops, Andi Kleen, (Fri Sep 21, 4:44 pm)
[PATCH] [1/45] x86: misc. constifications, Andi Kleen, (Fri Sep 21, 4:44 pm)