Skip to content

Commit 68b5e43

Browse files
committed
x86/mce: Fix -Wmissing-prototypes warnings
Add the proper includes and make smca_get_name() static. Fix an actual bug too which the warning triggered: arch/x86/kernel/cpu/mcheck/therm_throt.c:395:39: error: conflicting \ types for ‘smp_thermal_interrupt’ asmlinkage __visible void __irq_entry smp_thermal_interrupt(struct pt_regs *r) ^~~~~~~~~~~~~~~~~~~~~ In file included from arch/x86/kernel/cpu/mcheck/therm_throt.c:29: ./arch/x86/include/asm/traps.h:107:17: note: previous declaration of \ ‘smp_thermal_interrupt’ was here asmlinkage void smp_thermal_interrupt(void); Signed-off-by: Borislav Petkov <bp@suse.de> Cc: Yi Wang <wang.yi59@zte.com.cn> Cc: Michael Matz <matz@suse.de> Cc: x86@kernel.org Link: https://lkml.kernel.org/r/alpine.DEB.2.21.1811081633160.1549@nanos.tec.linutronix.de
1 parent 63ecd3b commit 68b5e43

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

arch/x86/include/asm/traps.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ extern int panic_on_unrecovered_nmi;
104104

105105
void math_emulate(struct math_emu_info *);
106106
#ifndef CONFIG_X86_32
107-
asmlinkage void smp_thermal_interrupt(void);
108-
asmlinkage void smp_threshold_interrupt(void);
109-
asmlinkage void smp_deferred_error_interrupt(void);
107+
asmlinkage void smp_thermal_interrupt(struct pt_regs *regs);
108+
asmlinkage void smp_threshold_interrupt(struct pt_regs *regs);
109+
asmlinkage void smp_deferred_error_interrupt(struct pt_regs *regs);
110110
#endif
111111

112112
extern void ist_enter(struct pt_regs *regs);

arch/x86/kernel/cpu/mcheck/mce_amd.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <linux/string.h>
2424

2525
#include <asm/amd_nb.h>
26+
#include <asm/traps.h>
2627
#include <asm/apic.h>
2728
#include <asm/mce.h>
2829
#include <asm/msr.h>
@@ -99,7 +100,7 @@ static u32 smca_bank_addrs[MAX_NR_BANKS][NR_BLOCKS] __ro_after_init =
99100
[0 ... MAX_NR_BANKS - 1] = { [0 ... NR_BLOCKS - 1] = -1 }
100101
};
101102

102-
const char *smca_get_name(enum smca_bank_types t)
103+
static const char *smca_get_name(enum smca_bank_types t)
103104
{
104105
if (t >= N_SMCA_BANK_TYPES)
105106
return NULL;
@@ -825,7 +826,7 @@ static void __log_error(unsigned int bank, u64 status, u64 addr, u64 misc)
825826
mce_log(&m);
826827
}
827828

828-
asmlinkage __visible void __irq_entry smp_deferred_error_interrupt(void)
829+
asmlinkage __visible void __irq_entry smp_deferred_error_interrupt(struct pt_regs *regs)
829830
{
830831
entering_irq();
831832
trace_deferred_error_apic_entry(DEFERRED_ERROR_VECTOR);

arch/x86/kernel/cpu/mcheck/therm_throt.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include <linux/cpu.h>
2626

2727
#include <asm/processor.h>
28+
#include <asm/traps.h>
2829
#include <asm/apic.h>
2930
#include <asm/mce.h>
3031
#include <asm/msr.h>
@@ -390,7 +391,7 @@ static void unexpected_thermal_interrupt(void)
390391

391392
static void (*smp_thermal_vector)(void) = unexpected_thermal_interrupt;
392393

393-
asmlinkage __visible void __irq_entry smp_thermal_interrupt(struct pt_regs *r)
394+
asmlinkage __visible void __irq_entry smp_thermal_interrupt(struct pt_regs *regs)
394395
{
395396
entering_irq();
396397
trace_thermal_apic_entry(THERMAL_APIC_VECTOR);

arch/x86/kernel/cpu/mcheck/threshold.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <linux/kernel.h>
77

88
#include <asm/irq_vectors.h>
9+
#include <asm/traps.h>
910
#include <asm/apic.h>
1011
#include <asm/mce.h>
1112
#include <asm/trace/irq_vectors.h>
@@ -18,7 +19,7 @@ static void default_threshold_interrupt(void)
1819

1920
void (*mce_threshold_vector)(void) = default_threshold_interrupt;
2021

21-
asmlinkage __visible void __irq_entry smp_threshold_interrupt(void)
22+
asmlinkage __visible void __irq_entry smp_threshold_interrupt(struct pt_regs *regs)
2223
{
2324
entering_irq();
2425
trace_threshold_apic_entry(THRESHOLD_APIC_VECTOR);

0 commit comments

Comments
 (0)