Skip to contentSkip to conversation

x86: mce: Fix build warning when !CONFIG_X86_LOCAL_APIC

PATCH In review Augusto Mecking Caringi 2 participants 2 messages Dec 29, 2016 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: mce: Fix build warning when !CONFIG_X86_LOCAL_APIC

The mce_irq_ipi() function is only called inside a #ifdef CONFIG_X86_LOCAL_APIC block, if this option is disabled gcc gives the following build warning:

arch/x86/kernel/cpu/mcheck/mce-inject.c:97:13: warning: ‘mce_irq_ipi’ defined but not used [-Wunused-function]
static void mce_irq_ipi(void *info)

             ^

Fix it marking this function as __maybe_unused.

---
 arch/x86/kernel/cpu/mcheck/mce-inject.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/cpu/mcheck/mce-inject.c +1 -1
index 517619e..cd1fb58 100644
@@ -94,7 +94,7 @@ static int mce_raise_notify(unsigned int cmd, struct pt_regs *regs)
 	return NMI_HANDLED;
 }
 
-static void mce_irq_ipi(void *info)
+static void __maybe_unused mce_irq_ipi(void *info)
 {
 	int cpu = smp_processor_id();
 	struct mce *m = this_cpu_ptr(&injectm);
Signature · 1 line
2.7.4
maintainer
#1 lore raw
Quoted 10 lines · Augusto Mecking Caringi

The mce_irq_ipi() function is only called inside a #ifdef CONFIG_X86_LOCAL_APIC block, if this option is disabled gcc gives the following build warning:

arch/x86/kernel/cpu/mcheck/mce-inject.c:97:13: warning: ‘mce_irq_ipi’ defined but not used [-Wunused-function]
static void mce_irq_ipi(void *info)

            ^

Fix it marking this function as __maybe_unused.

See http://lkml.kernel.org/r/[email protected]

Signature · 1 line
Sent from a small device: formatting sux and brevity is inevitable.