[PATCH] x86: mce: Fix build warning when !CONFIG_X86_LOCAL_APIC
From: Augusto Mecking Caringi
Date: Thu Dec 29 2016 - 10:29:36 EST
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.
Signed-off-by: Augusto Mecking Caringi <augustocaringi@xxxxxxxxx>
---
arch/x86/kernel/cpu/mcheck/mce-inject.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kernel/cpu/mcheck/mce-inject.c b/arch/x86/kernel/cpu/mcheck/mce-inject.c
index 517619e..cd1fb58 100644
--- a/arch/x86/kernel/cpu/mcheck/mce-inject.c
+++ b/arch/x86/kernel/cpu/mcheck/mce-inject.c
@@ -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);
--
2.7.4