Skip to content

Commit

Permalink
x86/kernel: Fix more -Wmissing-prototypes warnings
Browse files Browse the repository at this point in the history
... 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 <[email protected]>.

Signed-off-by: Borislav Petkov <[email protected]>
Reviewed-by: Masami Hiramatsu <[email protected]>
Reviewed-by: Ingo Molnar <[email protected]>
Acked-by: Rafael J. Wysocki <[email protected]> # ACPI + cpufreq bits
Cc: Andrew Banman <[email protected]>
Cc: Dimitri Sivanich <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Masami Hiramatsu <[email protected]>
Cc: Mike Travis <[email protected]>
Cc: "Steven Rostedt (VMware)" <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Yi Wang <[email protected]>
Cc: [email protected]
  • Loading branch information
suryasaimadhu committed Dec 8, 2018
1 parent a97673a commit ad3bc25
Show file tree
Hide file tree
Showing 21 changed files with 42 additions and 8 deletions.
3 changes: 3 additions & 0 deletions arch/x86/include/asm/setup.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ extern unsigned long saved_video_mode;

extern void reserve_standard_io_resources(void);
extern void i386_reserve_resources(void);
extern unsigned long __startup_64(unsigned long physaddr, struct boot_params *bp);
extern unsigned long __startup_secondary_64(void);
extern int early_make_pgtable(unsigned long address);

#ifdef CONFIG_X86_INTEL_MID
extern void x86_intel_mid_early_setup(void);
Expand Down
1 change: 1 addition & 0 deletions arch/x86/include/asm/trace/exceptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ DEFINE_PAGE_FAULT_EVENT(page_fault_user);
DEFINE_PAGE_FAULT_EVENT(page_fault_kernel);

#undef TRACE_INCLUDE_PATH
#undef TRACE_INCLUDE_FILE
#define TRACE_INCLUDE_PATH .
#define TRACE_INCLUDE_FILE exceptions
#endif /* _TRACE_PAGE_FAULT_H */
Expand Down
1 change: 1 addition & 0 deletions arch/x86/include/asm/trace/irq_vectors.h
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ TRACE_EVENT(vector_free_moved,
#endif /* CONFIG_X86_LOCAL_APIC */

#undef TRACE_INCLUDE_PATH
#undef TRACE_INCLUDE_FILE
#define TRACE_INCLUDE_PATH .
#define TRACE_INCLUDE_FILE irq_vectors
#endif /* _TRACE_IRQ_VECTORS_H */
Expand Down
5 changes: 5 additions & 0 deletions arch/x86/include/asm/traps.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ asmlinkage void smp_threshold_interrupt(struct pt_regs *regs);
asmlinkage void smp_deferred_error_interrupt(struct pt_regs *regs);
#endif

void smp_apic_timer_interrupt(struct pt_regs *regs);
void smp_spurious_interrupt(struct pt_regs *regs);
void smp_error_interrupt(struct pt_regs *regs);
asmlinkage void smp_irq_move_cleanup_interrupt(void);

extern void ist_enter(struct pt_regs *regs);
extern void ist_exit(struct pt_regs *regs);
extern void ist_begin_non_atomic(struct pt_regs *regs);
Expand Down
1 change: 1 addition & 0 deletions arch/x86/kernel/apic/apic.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
#include <asm/mpspec.h>
#include <asm/i8259.h>
#include <asm/proto.h>
#include <asm/traps.h>
#include <asm/apic.h>
#include <asm/io_apic.h>
#include <asm/desc.h>
Expand Down
7 changes: 4 additions & 3 deletions arch/x86/kernel/apic/apic_flat_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* Martin Bligh, Andi Kleen, James Bottomley, John Stultz, and
* James Cleverdon.
*/
#include <linux/acpi.h>
#include <linux/errno.h>
#include <linux/threads.h>
#include <linux/cpumask.h>
Expand All @@ -16,13 +17,13 @@
#include <linux/ctype.h>
#include <linux/hardirq.h>
#include <linux/export.h>

#include <asm/smp.h>
#include <asm/apic.h>
#include <asm/ipi.h>
#include <asm/apic.h>
#include <asm/apic_flat_64.h>
#include <asm/jailhouse_para.h>

#include <linux/acpi.h>

static struct apic apic_physflat;
static struct apic apic_flat;

Expand Down
1 change: 1 addition & 0 deletions arch/x86/kernel/apic/vector.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <linux/slab.h>
#include <asm/irqdomain.h>
#include <asm/hw_irq.h>
#include <asm/traps.h>
#include <asm/apic.h>
#include <asm/i8259.h>
#include <asm/desc.h>
Expand Down
4 changes: 2 additions & 2 deletions arch/x86/kernel/apic/x2apic_uv_x.c
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,7 @@ late_initcall(uv_init_heartbeat);
#endif /* !CONFIG_HOTPLUG_CPU */

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

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

void __init uv_init_hub_info(struct uv_hub_info_s *hi)
static void __init uv_init_hub_info(struct uv_hub_info_s *hi)
{
union uvh_node_id_u node_id;
struct mn mn;
Expand Down
3 changes: 2 additions & 1 deletion arch/x86/kernel/asm-offsets.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
# include "asm-offsets_64.c"
#endif

void common(void) {
static void __used common(void)
{
BLANK();
OFFSET(TASK_threadsp, task_struct, thread.sp);
#ifdef CONFIG_STACKPROTECTOR
Expand Down
1 change: 1 addition & 0 deletions arch/x86/kernel/cpu/amd.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <asm/smp.h>
#include <asm/pci-direct.h>
#include <asm/delay.h>
#include <asm/debugreg.h>

#ifdef CONFIG_X86_64
# include <asm/mmconfig.h>
Expand Down
1 change: 1 addition & 0 deletions arch/x86/kernel/cpu/aperfmperf.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <linux/ktime.h>
#include <linux/math64.h>
#include <linux/percpu.h>
#include <linux/cpufreq.h>
#include <linux/smp.h>

#include "cpu.h"
Expand Down
2 changes: 2 additions & 0 deletions arch/x86/kernel/cpu/bugs.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
#include <asm/e820/api.h>
#include <asm/hypervisor.h>

#include "cpu.h"

static void __init spectre_v2_select_mitigation(void);
static void __init ssb_select_mitigation(void);
static void __init l1tf_select_mitigation(void);
Expand Down
1 change: 1 addition & 0 deletions arch/x86/kernel/cpu/cacheinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <linux/pci.h>

#include <asm/cpufeature.h>
#include <asm/cacheinfo.h>
#include <asm/amd_nb.h>
#include <asm/smp.h>

Expand Down
3 changes: 2 additions & 1 deletion arch/x86/kernel/cpu/scattered.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
#include <linux/cpu.h>

#include <asm/pat.h>
#include <asm/apic.h>
#include <asm/processor.h>

#include <asm/apic.h>
#include "cpu.h"

struct cpuid_bit {
u16 feature;
Expand Down
2 changes: 2 additions & 0 deletions arch/x86/kernel/cpu/topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#include <asm/pat.h>
#include <asm/processor.h>

#include "cpu.h"

/* leaf 0xb SMT level */
#define SMT_LEVEL 0

Expand Down
2 changes: 1 addition & 1 deletion arch/x86/kernel/fpu/xstate.c
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ void fpu__resume_cpu(void)
*
* Note: does not work for compacted buffers.
*/
void *__raw_xsave_addr(struct xregs_state *xsave, int xstate_feature_mask)
static void *__raw_xsave_addr(struct xregs_state *xsave, int xstate_feature_mask)
{
int feature_nr = fls64(xstate_feature_mask) - 1;

Expand Down
2 changes: 2 additions & 0 deletions arch/x86/kernel/kprobes/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@

#include "common.h"

void *trampoline_handler(struct pt_regs *regs);

DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL;
DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk);

Expand Down
3 changes: 3 additions & 0 deletions arch/x86/kernel/sysfb_efi.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@

#include <linux/dmi.h>
#include <linux/err.h>
#include <linux/efi.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/pci.h>
#include <linux/screen_info.h>
#include <video/vga.h>

#include <asm/efi.h>
#include <asm/sysfb.h>

enum {
Expand Down
1 change: 1 addition & 0 deletions arch/x86/kernel/tracepoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <asm/hw_irq.h>
#include <asm/desc.h>
#include <asm/trace/exceptions.h>
#include <asm/trace/irq_vectors.h>

DEFINE_STATIC_KEY_FALSE(trace_pagefault_key);

Expand Down
3 changes: 3 additions & 0 deletions include/acpi/cppc_acpi.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,5 +142,8 @@ extern int cppc_set_perf(int cpu, struct cppc_perf_ctrls *perf_ctrls);
extern int cppc_get_perf_caps(int cpu, struct cppc_perf_caps *caps);
extern int acpi_get_psd_map(struct cppc_cpudata **);
extern unsigned int cppc_get_transition_latency(int cpu);
extern bool cpc_ffh_supported(void);
extern int cpc_read_ffh(int cpunum, struct cpc_reg *reg, u64 *val);
extern int cpc_write_ffh(int cpunum, struct cpc_reg *reg, u64 val);

#endif /* _CPPC_ACPI_H*/
3 changes: 3 additions & 0 deletions include/linux/kprobes.h
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,9 @@ int enable_kprobe(struct kprobe *kp);

void dump_kprobe(struct kprobe *kp);

void *alloc_insn_page(void);
void free_insn_page(void *page);

#else /* !CONFIG_KPROBES: */

static inline int kprobes_built_in(void)
Expand Down

0 comments on commit ad3bc25

Please sign in to comment.