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

From: Dave Jones
Date: Fri Sep 21 2007 - 17:08:34 EST


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@xxxxxxxxxx>

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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/