Skip to contentSkip to conversation

Fix arch/i386/kernel/nmi.c - 'unknown_nmi_panic_callback' declared 'static' but never defined warning

PATCH In review Gabriel C 3 participants 3 messages Jul 22, 2007 – Jul 25, 2007 1 message not in the archive

lore
Share & tools
lore

Gabriel C

author
#0 lore raw

PATCH 1/1 Fix arch/i386/kernel/nmi.c - 'unknown_nmi_panic_callback' declared 'static' but never defined warning

Hi,

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

...

---

arch/i386/kernel/nmi.c +2 -1
index 03b7f55..cf11121 100644
@@ -49,8 +49,9 @@ static unsigned int nmi_hz = HZ;
 static DEFINE_PER_CPU(short, wd_enabled);
 
 /* local prototypes */
+#ifdef CONFIG_SYSCTL
 static int unknown_nmi_panic_callback(struct pt_regs *regs, int cpu);
-
+#endif
 static int endflag __initdata = 0;
 
 #ifdef CONFIG_SMP
#1 lore raw
Quoted 17 lines · On Sun, 22 Jul 2007 21:20:38 +0200 Gabriel C <[email protected]> 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

...

---

arch/i386/kernel/nmi.c +0 -0
index 03b7f55..cf11121 100644

arch/i386/kernel/nmi.c static unsigned int nmi_hz = HZ; · line 55

Quoted 8 lines
arch/i386/kernel/nmi.c +2 -1
@@ -49,8 +49,9 @@ static unsigned int nmi_hz = HZ;
 static DEFINE_PER_CPU(short, wd_enabled);
 
 /* local prototypes */
+#ifdef CONFIG_SYSCTL
 static int unknown_nmi_panic_callback(struct pt_regs *regs, int cpu);
-
+#endif
 static int endflag __initdata = 0;

guys, please take a closer look at the code which you're changing? We can obviously move do_nmi_callback() down to above __trigger_all_cpu_backtrace() and then do away with this declaration altogether.

#3 lore raw
In reply to a message not in the archive
Quoted 31 lines · Gabriel C

---------- Forwarded message ----------
From: Andrew Morton <[email protected]>
Date: 25.07.2007 03:36
Subject: Re: [PATCH] Fix arch/i386/kernel/nmi.c - 'unknown_nmi_panic_callback' declared 'static' but never defined warning
To: Gabriel C <[email protected]>
Cc: Linux Kernel Mailing List <[email protected]>, Ingo Molnar < [email protected]>, Andi Kleen <[email protected]>

Quoted 5 lines · On Sun, 22 Jul 2007 21:20:38 +0200 Gabriel C <[email protected]> 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

Quoted 13 lines

...

---

arch/i386/kernel/nmi.c +0 -0
index 03b7f55..cf11121 100644
@@ -49,8 +49,9 @@ static unsigned int nmi_hz = HZ;
 static DEFINE_PER_CPU(short, wd_enabled);
 
Quoted 12 lines

arch/i386/kernel/nmi.c static unsigned int nmi_hz = HZ; · line 55

Quoted 6 lines
arch/i386/kernel/nmi.c +2 -1
 /* local prototypes */
+#ifdef CONFIG_SYSCTL
 static int unknown_nmi_panic_callback(struct pt_regs *regs, int cpu);
-
+#endif
 static int endflag __initdata = 0;

guys, please take a closer look at the code which you're changing? We can obviously move do_nmi_callback() down to above __trigger_all_cpu_backtrace() and then do away with this declaration altogether.

I will try to do it better next time , sorry.

Oh and I just realized the fix ( whatever it will be at least ) need be done for arch/x86_64/kernel/nmi.c too.

Regards,

Gabriel