diff options
| author | Borislav Petkov <bp@suse.de> | 2018-11-09 17:13:13 -0500 |
|---|---|---|
| committer | Borislav Petkov <bp@suse.de> | 2018-11-14 07:46:26 -0500 |
| commit | 68b5e4326e4b8ac9080835005d8254fed0fb3c56 (patch) | |
| tree | 99e673d2a1b2ff9ae25ffac8ba2c31d5d5a09565 | |
| parent | 63ecd3b13d5cf07959a2315ec62a7c62e20df114 (diff) | |
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
| -rw-r--r-- | arch/x86/include/asm/traps.h | 6 | ||||
| -rw-r--r-- | arch/x86/kernel/cpu/mcheck/mce_amd.c | 5 | ||||
| -rw-r--r-- | arch/x86/kernel/cpu/mcheck/therm_throt.c | 3 | ||||
| -rw-r--r-- | arch/x86/kernel/cpu/mcheck/threshold.c | 3 |
4 files changed, 10 insertions, 7 deletions
diff --git a/arch/x86/include/asm/traps.h b/arch/x86/include/asm/traps.h index 3de69330e6c5..afbc87206886 100644 --- a/arch/x86/include/asm/traps.h +++ b/arch/x86/include/asm/traps.h | |||
| @@ -104,9 +104,9 @@ extern int panic_on_unrecovered_nmi; | |||
| 104 | 104 | ||
| 105 | void math_emulate(struct math_emu_info *); | 105 | void math_emulate(struct math_emu_info *); |
| 106 | #ifndef CONFIG_X86_32 | 106 | #ifndef CONFIG_X86_32 |
| 107 | asmlinkage void smp_thermal_interrupt(void); | 107 | asmlinkage void smp_thermal_interrupt(struct pt_regs *regs); |
| 108 | asmlinkage void smp_threshold_interrupt(void); | 108 | asmlinkage void smp_threshold_interrupt(struct pt_regs *regs); |
| 109 | asmlinkage void smp_deferred_error_interrupt(void); | 109 | asmlinkage void smp_deferred_error_interrupt(struct pt_regs *regs); |
| 110 | #endif | 110 | #endif |
| 111 | 111 | ||
| 112 | extern void ist_enter(struct pt_regs *regs); | 112 | extern void ist_enter(struct pt_regs *regs); |
diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd.c b/arch/x86/kernel/cpu/mcheck/mce_amd.c index dd33c357548f..9c8e2daa48cd 100644 --- a/arch/x86/kernel/cpu/mcheck/mce_amd.c +++ b/arch/x86/kernel/cpu/mcheck/mce_amd.c | |||
| @@ -23,6 +23,7 @@ | |||
| 23 | #include <linux/string.h> | 23 | #include <linux/string.h> |
| 24 | 24 | ||
| 25 | #include <asm/amd_nb.h> | 25 | #include <asm/amd_nb.h> |
| 26 | #include <asm/traps.h> | ||
| 26 | #include <asm/apic.h> | 27 | #include <asm/apic.h> |
| 27 | #include <asm/mce.h> | 28 | #include <asm/mce.h> |
| 28 | #include <asm/msr.h> | 29 | #include <asm/msr.h> |
| @@ -99,7 +100,7 @@ static u32 smca_bank_addrs[MAX_NR_BANKS][NR_BLOCKS] __ro_after_init = | |||
| 99 | [0 ... MAX_NR_BANKS - 1] = { [0 ... NR_BLOCKS - 1] = -1 } | 100 | [0 ... MAX_NR_BANKS - 1] = { [0 ... NR_BLOCKS - 1] = -1 } |
| 100 | }; | 101 | }; |
| 101 | 102 | ||
| 102 | const char *smca_get_name(enum smca_bank_types t) | 103 | static const char *smca_get_name(enum smca_bank_types t) |
| 103 | { | 104 | { |
| 104 | if (t >= N_SMCA_BANK_TYPES) | 105 | if (t >= N_SMCA_BANK_TYPES) |
| 105 | return NULL; | 106 | return NULL; |
| @@ -825,7 +826,7 @@ static void __log_error(unsigned int bank, u64 status, u64 addr, u64 misc) | |||
| 825 | mce_log(&m); | 826 | mce_log(&m); |
| 826 | } | 827 | } |
| 827 | 828 | ||
| 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) |
| 829 | { | 830 | { |
| 830 | entering_irq(); | 831 | entering_irq(); |
| 831 | trace_deferred_error_apic_entry(DEFERRED_ERROR_VECTOR); | 832 | trace_deferred_error_apic_entry(DEFERRED_ERROR_VECTOR); |
diff --git a/arch/x86/kernel/cpu/mcheck/therm_throt.c b/arch/x86/kernel/cpu/mcheck/therm_throt.c index 2da67b70ba98..ee229ceee745 100644 --- a/arch/x86/kernel/cpu/mcheck/therm_throt.c +++ b/arch/x86/kernel/cpu/mcheck/therm_throt.c | |||
| @@ -25,6 +25,7 @@ | |||
| 25 | #include <linux/cpu.h> | 25 | #include <linux/cpu.h> |
| 26 | 26 | ||
| 27 | #include <asm/processor.h> | 27 | #include <asm/processor.h> |
| 28 | #include <asm/traps.h> | ||
| 28 | #include <asm/apic.h> | 29 | #include <asm/apic.h> |
| 29 | #include <asm/mce.h> | 30 | #include <asm/mce.h> |
| 30 | #include <asm/msr.h> | 31 | #include <asm/msr.h> |
| @@ -390,7 +391,7 @@ static void unexpected_thermal_interrupt(void) | |||
| 390 | 391 | ||
| 391 | static void (*smp_thermal_vector)(void) = unexpected_thermal_interrupt; | 392 | static void (*smp_thermal_vector)(void) = unexpected_thermal_interrupt; |
| 392 | 393 | ||
| 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) |
| 394 | { | 395 | { |
| 395 | entering_irq(); | 396 | entering_irq(); |
| 396 | trace_thermal_apic_entry(THERMAL_APIC_VECTOR); | 397 | trace_thermal_apic_entry(THERMAL_APIC_VECTOR); |
diff --git a/arch/x86/kernel/cpu/mcheck/threshold.c b/arch/x86/kernel/cpu/mcheck/threshold.c index 2b584b319eff..c21e0a1efd0f 100644 --- a/arch/x86/kernel/cpu/mcheck/threshold.c +++ b/arch/x86/kernel/cpu/mcheck/threshold.c | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | #include <linux/kernel.h> | 6 | #include <linux/kernel.h> |
| 7 | 7 | ||
| 8 | #include <asm/irq_vectors.h> | 8 | #include <asm/irq_vectors.h> |
| 9 | #include <asm/traps.h> | ||
| 9 | #include <asm/apic.h> | 10 | #include <asm/apic.h> |
| 10 | #include <asm/mce.h> | 11 | #include <asm/mce.h> |
| 11 | #include <asm/trace/irq_vectors.h> | 12 | #include <asm/trace/irq_vectors.h> |
| @@ -18,7 +19,7 @@ static void default_threshold_interrupt(void) | |||
| 18 | 19 | ||
| 19 | void (*mce_threshold_vector)(void) = default_threshold_interrupt; | 20 | void (*mce_threshold_vector)(void) = default_threshold_interrupt; |
| 20 | 21 | ||
| 21 | asmlinkage __visible void __irq_entry smp_threshold_interrupt(void) | 22 | asmlinkage __visible void __irq_entry smp_threshold_interrupt(struct pt_regs *regs) |
| 22 | { | 23 | { |
| 23 | entering_irq(); | 24 | entering_irq(); |
| 24 | trace_threshold_apic_entry(THRESHOLD_APIC_VECTOR); | 25 | trace_threshold_apic_entry(THRESHOLD_APIC_VECTOR); |
