Skip to content

Commit ad3bc25

Browse files
committed
x86/kernel: Fix more -Wmissing-prototypes warnings
... with the goal of eventually enabling -Wmissing-prototypes by default. At least on x86. Make functions static where possible, otherwise add prototypes or make them visible through includes. asm/trace/ changes courtesy of Steven Rostedt <rostedt@goodmis.org>. Signed-off-by: Borislav Petkov <bp@suse.de> Reviewed-by: Masami Hiramatsu <mhiramat@kernel.org> Reviewed-by: Ingo Molnar <mingo@kernel.org> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> # ACPI + cpufreq bits Cc: Andrew Banman <andrew.banman@hpe.com> Cc: Dimitri Sivanich <dimitri.sivanich@hpe.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: Mike Travis <mike.travis@hpe.com> Cc: "Steven Rostedt (VMware)" <rostedt@goodmis.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Yi Wang <wang.yi59@zte.com.cn> Cc: linux-acpi@vger.kernel.org
1 parent a97673a commit ad3bc25

File tree

21 files changed

+42
-8
lines changed

21 files changed

+42
-8
lines changed

arch/x86/include/asm/setup.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ extern unsigned long saved_video_mode;
4646

4747
extern void reserve_standard_io_resources(void);
4848
extern void i386_reserve_resources(void);
49+
extern unsigned long __startup_64(unsigned long physaddr, struct boot_params *bp);
50+
extern unsigned long __startup_secondary_64(void);
51+
extern int early_make_pgtable(unsigned long address);
4952

5053
#ifdef CONFIG_X86_INTEL_MID
5154
extern void x86_intel_mid_early_setup(void);

arch/x86/include/asm/trace/exceptions.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ DEFINE_PAGE_FAULT_EVENT(page_fault_user);
4545
DEFINE_PAGE_FAULT_EVENT(page_fault_kernel);
4646

4747
#undef TRACE_INCLUDE_PATH
48+
#undef TRACE_INCLUDE_FILE
4849
#define TRACE_INCLUDE_PATH .
4950
#define TRACE_INCLUDE_FILE exceptions
5051
#endif /* _TRACE_PAGE_FAULT_H */

arch/x86/include/asm/trace/irq_vectors.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@ TRACE_EVENT(vector_free_moved,
389389
#endif /* CONFIG_X86_LOCAL_APIC */
390390

391391
#undef TRACE_INCLUDE_PATH
392+
#undef TRACE_INCLUDE_FILE
392393
#define TRACE_INCLUDE_PATH .
393394
#define TRACE_INCLUDE_FILE irq_vectors
394395
#endif /* _TRACE_IRQ_VECTORS_H */

arch/x86/include/asm/traps.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,11 @@ asmlinkage void smp_threshold_interrupt(struct pt_regs *regs);
113113
asmlinkage void smp_deferred_error_interrupt(struct pt_regs *regs);
114114
#endif
115115

116+
void smp_apic_timer_interrupt(struct pt_regs *regs);
117+
void smp_spurious_interrupt(struct pt_regs *regs);
118+
void smp_error_interrupt(struct pt_regs *regs);
119+
asmlinkage void smp_irq_move_cleanup_interrupt(void);
120+
116121
extern void ist_enter(struct pt_regs *regs);
117122
extern void ist_exit(struct pt_regs *regs);
118123
extern void ist_begin_non_atomic(struct pt_regs *regs);

arch/x86/kernel/apic/apic.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
#include <asm/mpspec.h>
4545
#include <asm/i8259.h>
4646
#include <asm/proto.h>
47+
#include <asm/traps.h>
4748
#include <asm/apic.h>
4849
#include <asm/io_apic.h>
4950
#include <asm/desc.h>

arch/x86/kernel/apic/apic_flat_64.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* Martin Bligh, Andi Kleen, James Bottomley, John Stultz, and
99
* James Cleverdon.
1010
*/
11+
#include <linux/acpi.h>
1112
#include <linux/errno.h>
1213
#include <linux/threads.h>
1314
#include <linux/cpumask.h>
@@ -16,13 +17,13 @@
1617
#include <linux/ctype.h>
1718
#include <linux/hardirq.h>
1819
#include <linux/export.h>
20+
1921
#include <asm/smp.h>
20-
#include <asm/apic.h>
2122
#include <asm/ipi.h>
23+
#include <asm/apic.h>
24+
#include <asm/apic_flat_64.h>
2225
#include <asm/jailhouse_para.h>
2326

24-
#include <linux/acpi.h>
25-
2627
static struct apic apic_physflat;
2728
static struct apic apic_flat;
2829

arch/x86/kernel/apic/vector.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <linux/slab.h>
1919
#include <asm/irqdomain.h>
2020
#include <asm/hw_irq.h>
21+
#include <asm/traps.h>
2122
#include <asm/apic.h>
2223
#include <asm/i8259.h>
2324
#include <asm/desc.h>

arch/x86/kernel/apic/x2apic_uv_x.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,7 +1079,7 @@ late_initcall(uv_init_heartbeat);
10791079
#endif /* !CONFIG_HOTPLUG_CPU */
10801080

10811081
/* Direct Legacy VGA I/O traffic to designated IOH */
1082-
int uv_set_vga_state(struct pci_dev *pdev, bool decode, unsigned int command_bits, u32 flags)
1082+
static int uv_set_vga_state(struct pci_dev *pdev, bool decode, unsigned int command_bits, u32 flags)
10831083
{
10841084
int domain, bus, rc;
10851085

@@ -1148,7 +1148,7 @@ static void get_mn(struct mn *mnp)
11481148
mnp->m_shift = mnp->m_val ? 64 - mnp->m_val : 0;
11491149
}
11501150

1151-
void __init uv_init_hub_info(struct uv_hub_info_s *hi)
1151+
static void __init uv_init_hub_info(struct uv_hub_info_s *hi)
11521152
{
11531153
union uvh_node_id_u node_id;
11541154
struct mn mn;

arch/x86/kernel/asm-offsets.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
# include "asm-offsets_64.c"
3030
#endif
3131

32-
void common(void) {
32+
static void __used common(void)
33+
{
3334
BLANK();
3435
OFFSET(TASK_threadsp, task_struct, thread.sp);
3536
#ifdef CONFIG_STACKPROTECTOR

arch/x86/kernel/cpu/amd.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <asm/smp.h>
1616
#include <asm/pci-direct.h>
1717
#include <asm/delay.h>
18+
#include <asm/debugreg.h>
1819

1920
#ifdef CONFIG_X86_64
2021
# include <asm/mmconfig.h>

arch/x86/kernel/cpu/aperfmperf.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <linux/ktime.h>
1313
#include <linux/math64.h>
1414
#include <linux/percpu.h>
15+
#include <linux/cpufreq.h>
1516
#include <linux/smp.h>
1617

1718
#include "cpu.h"

arch/x86/kernel/cpu/bugs.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
#include <asm/e820/api.h>
3333
#include <asm/hypervisor.h>
3434

35+
#include "cpu.h"
36+
3537
static void __init spectre_v2_select_mitigation(void);
3638
static void __init ssb_select_mitigation(void);
3739
static void __init l1tf_select_mitigation(void);

arch/x86/kernel/cpu/cacheinfo.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <linux/pci.h>
1818

1919
#include <asm/cpufeature.h>
20+
#include <asm/cacheinfo.h>
2021
#include <asm/amd_nb.h>
2122
#include <asm/smp.h>
2223

arch/x86/kernel/cpu/scattered.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
#include <linux/cpu.h>
66

77
#include <asm/pat.h>
8+
#include <asm/apic.h>
89
#include <asm/processor.h>
910

10-
#include <asm/apic.h>
11+
#include "cpu.h"
1112

1213
struct cpuid_bit {
1314
u16 feature;

arch/x86/kernel/cpu/topology.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
#include <asm/pat.h>
1111
#include <asm/processor.h>
1212

13+
#include "cpu.h"
14+
1315
/* leaf 0xb SMT level */
1416
#define SMT_LEVEL 0
1517

arch/x86/kernel/fpu/xstate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,7 @@ void fpu__resume_cpu(void)
811811
*
812812
* Note: does not work for compacted buffers.
813813
*/
814-
void *__raw_xsave_addr(struct xregs_state *xsave, int xstate_feature_mask)
814+
static void *__raw_xsave_addr(struct xregs_state *xsave, int xstate_feature_mask)
815815
{
816816
int feature_nr = fls64(xstate_feature_mask) - 1;
817817

arch/x86/kernel/kprobes/core.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@
6666

6767
#include "common.h"
6868

69+
void *trampoline_handler(struct pt_regs *regs);
70+
6971
DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL;
7072
DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk);
7173

arch/x86/kernel/sysfb_efi.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,15 @@
1919

2020
#include <linux/dmi.h>
2121
#include <linux/err.h>
22+
#include <linux/efi.h>
2223
#include <linux/init.h>
2324
#include <linux/kernel.h>
2425
#include <linux/mm.h>
2526
#include <linux/pci.h>
2627
#include <linux/screen_info.h>
2728
#include <video/vga.h>
29+
30+
#include <asm/efi.h>
2831
#include <asm/sysfb.h>
2932

3033
enum {

arch/x86/kernel/tracepoint.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <asm/hw_irq.h>
1212
#include <asm/desc.h>
1313
#include <asm/trace/exceptions.h>
14+
#include <asm/trace/irq_vectors.h>
1415

1516
DEFINE_STATIC_KEY_FALSE(trace_pagefault_key);
1617

include/acpi/cppc_acpi.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,5 +142,8 @@ extern int cppc_set_perf(int cpu, struct cppc_perf_ctrls *perf_ctrls);
142142
extern int cppc_get_perf_caps(int cpu, struct cppc_perf_caps *caps);
143143
extern int acpi_get_psd_map(struct cppc_cpudata **);
144144
extern unsigned int cppc_get_transition_latency(int cpu);
145+
extern bool cpc_ffh_supported(void);
146+
extern int cpc_read_ffh(int cpunum, struct cpc_reg *reg, u64 *val);
147+
extern int cpc_write_ffh(int cpunum, struct cpc_reg *reg, u64 val);
145148

146149
#endif /* _CPPC_ACPI_H*/

include/linux/kprobes.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,9 @@ int enable_kprobe(struct kprobe *kp);
379379

380380
void dump_kprobe(struct kprobe *kp);
381381

382+
void *alloc_insn_page(void);
383+
void free_insn_page(void *page);
384+
382385
#else /* !CONFIG_KPROBES: */
383386

384387
static inline int kprobes_built_in(void)

0 commit comments

Comments
 (0)