Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+44 -10
+3
arch/x86/include/asm/setup.h
··· 46 46 47 47 extern void reserve_standard_io_resources(void); 48 48 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); 49 52 50 53 #ifdef CONFIG_X86_INTEL_MID 51 54 extern void x86_intel_mid_early_setup(void);
+1
arch/x86/include/asm/trace/exceptions.h
··· 45 45 DEFINE_PAGE_FAULT_EVENT(page_fault_kernel); 46 46 47 47 #undef TRACE_INCLUDE_PATH 48 + #undef TRACE_INCLUDE_FILE 48 49 #define TRACE_INCLUDE_PATH . 49 50 #define TRACE_INCLUDE_FILE exceptions 50 51 #endif /* _TRACE_PAGE_FAULT_H */
+1
arch/x86/include/asm/trace/irq_vectors.h
··· 389 389 #endif /* CONFIG_X86_LOCAL_APIC */ 390 390 391 391 #undef TRACE_INCLUDE_PATH 392 + #undef TRACE_INCLUDE_FILE 392 393 #define TRACE_INCLUDE_PATH . 393 394 #define TRACE_INCLUDE_FILE irq_vectors 394 395 #endif /* _TRACE_IRQ_VECTORS_H */
+5
arch/x86/include/asm/traps.h
··· 113 113 asmlinkage void smp_deferred_error_interrupt(struct pt_regs *regs); 114 114 #endif 115 115 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 + 116 121 extern void ist_enter(struct pt_regs *regs); 117 122 extern void ist_exit(struct pt_regs *regs); 118 123 extern void ist_begin_non_atomic(struct pt_regs *regs);
+1
arch/x86/kernel/apic/apic.c
··· 44 44 #include <asm/mpspec.h> 45 45 #include <asm/i8259.h> 46 46 #include <asm/proto.h> 47 + #include <asm/traps.h> 47 48 #include <asm/apic.h> 48 49 #include <asm/io_apic.h> 49 50 #include <asm/desc.h>
+6 -5
arch/x86/kernel/apic/apic_flat_64.c
··· 8 8 * Martin Bligh, Andi Kleen, James Bottomley, John Stultz, and 9 9 * James Cleverdon. 10 10 */ 11 + #include <linux/acpi.h> 11 12 #include <linux/errno.h> 12 13 #include <linux/threads.h> 13 14 #include <linux/cpumask.h> ··· 17 16 #include <linux/ctype.h> 18 17 #include <linux/hardirq.h> 19 18 #include <linux/export.h> 20 - #include <asm/smp.h> 21 - #include <asm/apic.h> 22 - #include <asm/ipi.h> 23 - #include <asm/jailhouse_para.h> 24 19 25 - #include <linux/acpi.h> 20 + #include <asm/smp.h> 21 + #include <asm/ipi.h> 22 + #include <asm/apic.h> 23 + #include <asm/apic_flat_64.h> 24 + #include <asm/jailhouse_para.h> 26 25 27 26 static struct apic apic_physflat; 28 27 static struct apic apic_flat;
+1
arch/x86/kernel/apic/vector.c
··· 18 18 #include <linux/slab.h> 19 19 #include <asm/irqdomain.h> 20 20 #include <asm/hw_irq.h> 21 + #include <asm/traps.h> 21 22 #include <asm/apic.h> 22 23 #include <asm/i8259.h> 23 24 #include <asm/desc.h>
+2 -2
arch/x86/kernel/apic/x2apic_uv_x.c
··· 1079 1079 #endif /* !CONFIG_HOTPLUG_CPU */ 1080 1080 1081 1081 /* 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) 1083 1083 { 1084 1084 int domain, bus, rc; 1085 1085 ··· 1148 1148 mnp->m_shift = mnp->m_val ? 64 - mnp->m_val : 0; 1149 1149 } 1150 1150 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) 1152 1152 { 1153 1153 union uvh_node_id_u node_id; 1154 1154 struct mn mn;
+2 -1
arch/x86/kernel/asm-offsets.c
··· 29 29 # include "asm-offsets_64.c" 30 30 #endif 31 31 32 - void common(void) { 32 + static void __used common(void) 33 + { 33 34 BLANK(); 34 35 OFFSET(TASK_threadsp, task_struct, thread.sp); 35 36 #ifdef CONFIG_STACKPROTECTOR
+1
arch/x86/kernel/cpu/amd.c
··· 15 15 #include <asm/smp.h> 16 16 #include <asm/pci-direct.h> 17 17 #include <asm/delay.h> 18 + #include <asm/debugreg.h> 18 19 19 20 #ifdef CONFIG_X86_64 20 21 # include <asm/mmconfig.h>
+1
arch/x86/kernel/cpu/aperfmperf.c
··· 12 12 #include <linux/ktime.h> 13 13 #include <linux/math64.h> 14 14 #include <linux/percpu.h> 15 + #include <linux/cpufreq.h> 15 16 #include <linux/smp.h> 16 17 17 18 #include "cpu.h"
+2
arch/x86/kernel/cpu/bugs.c
··· 32 32 #include <asm/e820/api.h> 33 33 #include <asm/hypervisor.h> 34 34 35 + #include "cpu.h" 36 + 35 37 static void __init spectre_v2_select_mitigation(void); 36 38 static void __init ssb_select_mitigation(void); 37 39 static void __init l1tf_select_mitigation(void);
+1
arch/x86/kernel/cpu/cacheinfo.c
··· 17 17 #include <linux/pci.h> 18 18 19 19 #include <asm/cpufeature.h> 20 + #include <asm/cacheinfo.h> 20 21 #include <asm/amd_nb.h> 21 22 #include <asm/smp.h> 22 23
+2 -1
arch/x86/kernel/cpu/scattered.c
··· 5 5 #include <linux/cpu.h> 6 6 7 7 #include <asm/pat.h> 8 + #include <asm/apic.h> 8 9 #include <asm/processor.h> 9 10 10 - #include <asm/apic.h> 11 + #include "cpu.h" 11 12 12 13 struct cpuid_bit { 13 14 u16 feature;
+2
arch/x86/kernel/cpu/topology.c
··· 10 10 #include <asm/pat.h> 11 11 #include <asm/processor.h> 12 12 13 + #include "cpu.h" 14 + 13 15 /* leaf 0xb SMT level */ 14 16 #define SMT_LEVEL 0 15 17
+1 -1
arch/x86/kernel/fpu/xstate.c
··· 811 811 * 812 812 * Note: does not work for compacted buffers. 813 813 */ 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) 815 815 { 816 816 int feature_nr = fls64(xstate_feature_mask) - 1; 817 817
+2
arch/x86/kernel/kprobes/core.c
··· 66 66 67 67 #include "common.h" 68 68 69 + void *trampoline_handler(struct pt_regs *regs); 70 + 69 71 DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL; 70 72 DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); 71 73
+3
arch/x86/kernel/sysfb_efi.c
··· 19 19 20 20 #include <linux/dmi.h> 21 21 #include <linux/err.h> 22 + #include <linux/efi.h> 22 23 #include <linux/init.h> 23 24 #include <linux/kernel.h> 24 25 #include <linux/mm.h> 25 26 #include <linux/pci.h> 26 27 #include <linux/screen_info.h> 27 28 #include <video/vga.h> 29 + 30 + #include <asm/efi.h> 28 31 #include <asm/sysfb.h> 29 32 30 33 enum {
+1
arch/x86/kernel/tracepoint.c
··· 11 11 #include <asm/hw_irq.h> 12 12 #include <asm/desc.h> 13 13 #include <asm/trace/exceptions.h> 14 + #include <asm/trace/irq_vectors.h> 14 15 15 16 DEFINE_STATIC_KEY_FALSE(trace_pagefault_key); 16 17
+3
include/acpi/cppc_acpi.h
··· 142 142 extern int cppc_get_perf_caps(int cpu, struct cppc_perf_caps *caps); 143 143 extern int acpi_get_psd_map(struct cppc_cpudata **); 144 144 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); 145 148 146 149 #endif /* _CPPC_ACPI_H*/
+3
include/linux/kprobes.h
··· 379 379 380 380 void dump_kprobe(struct kprobe *kp); 381 381 382 + void *alloc_insn_page(void); 383 + void free_insn_page(void *page); 384 + 382 385 #else /* !CONFIG_KPROBES: */ 383 386 384 387 static inline int kprobes_built_in(void)