Skip to content

Commit 5ed881b

Browse files
riscv: add missing header file includes
sparse identifies several missing prototypes caused by missing preprocessor include directives: arch/riscv/kernel/cpufeature.c:16:6: warning: symbol 'has_fpu' was not declared. Should it be static? arch/riscv/kernel/process.c:26:6: warning: symbol 'arch_cpu_idle' was not declared. Should it be static? arch/riscv/kernel/reset.c:15:6: warning: symbol 'pm_power_off' was not declared. Should it be static? arch/riscv/kernel/syscall_table.c:15:6: warning: symbol 'sys_call_table' was not declared. Should it be static? arch/riscv/kernel/traps.c:149:13: warning: symbol 'trap_init' was not declared. Should it be static? arch/riscv/kernel/vdso.c:54:5: warning: symbol 'arch_setup_additional_pages' was not declared. Should it be static? arch/riscv/kernel/smp.c:64:6: warning: symbol 'arch_match_cpu_phys_id' was not declared. Should it be static? arch/riscv/kernel/module-sections.c:89:5: warning: symbol 'module_frob_arch_sections' was not declared. Should it be static? arch/riscv/mm/context.c:42:6: warning: symbol 'switch_mm' was not declared. Should it be static? Fix by including the appropriate header files in the appropriate source files. This patch should have no functional impact. Signed-off-by: Paul Walmsley <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]>
1 parent bf6df5d commit 5ed881b

File tree

13 files changed

+17
-0
lines changed

13 files changed

+17
-0
lines changed

arch/riscv/include/asm/irq.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
#ifndef _ASM_RISCV_IRQ_H
88
#define _ASM_RISCV_IRQ_H
99

10+
#include <linux/interrupt.h>
11+
#include <linux/linkage.h>
12+
1013
#define NR_IRQS 0
1114

1215
void riscv_timer_interrupt(void);

arch/riscv/include/asm/switch_to.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#ifndef _ASM_RISCV_SWITCH_TO_H
77
#define _ASM_RISCV_SWITCH_TO_H
88

9+
#include <linux/sched/task_stack.h>
910
#include <asm/processor.h>
1011
#include <asm/ptrace.h>
1112
#include <asm/csr.h>

arch/riscv/kernel/cpufeature.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <asm/processor.h>
1111
#include <asm/hwcap.h>
1212
#include <asm/smp.h>
13+
#include <asm/switch_to.h>
1314

1415
unsigned long elf_hwcap __read_mostly;
1516
#ifdef CONFIG_FPU

arch/riscv/kernel/module-sections.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <linux/elf.h>
99
#include <linux/kernel.h>
1010
#include <linux/module.h>
11+
#include <linux/moduleloader.h>
1112

1213
unsigned long module_emit_got_entry(struct module *mod, unsigned long val)
1314
{

arch/riscv/kernel/process.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* Copyright (C) 2017 SiFive
88
*/
99

10+
#include <linux/cpu.h>
1011
#include <linux/kernel.h>
1112
#include <linux/sched.h>
1213
#include <linux/sched/task_stack.h>
@@ -19,6 +20,7 @@
1920
#include <asm/csr.h>
2021
#include <asm/string.h>
2122
#include <asm/switch_to.h>
23+
#include <asm/thread_info.h>
2224

2325
extern asmlinkage void ret_from_fork(void);
2426
extern asmlinkage void ret_from_kernel_thread(void);

arch/riscv/kernel/reset.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*/
55

66
#include <linux/reboot.h>
7+
#include <linux/pm.h>
78
#include <asm/sbi.h>
89

910
static void default_power_off(void)

arch/riscv/kernel/smp.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
* Copyright (C) 2017 SiFive
99
*/
1010

11+
#include <linux/cpu.h>
1112
#include <linux/interrupt.h>
13+
#include <linux/profile.h>
1214
#include <linux/smp.h>
1315
#include <linux/sched.h>
1416
#include <linux/seq_file.h>

arch/riscv/kernel/smpboot.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include <asm/tlbflush.h>
3030
#include <asm/sections.h>
3131
#include <asm/sbi.h>
32+
#include <asm/smp.h>
3233

3334
#include "head.h"
3435

arch/riscv/kernel/syscall_table.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <linux/syscalls.h>
99
#include <asm-generic/syscalls.h>
1010
#include <asm/vdso.h>
11+
#include <asm/syscall.h>
1112

1213
#undef __SYSCALL
1314
#define __SYSCALL(nr, call) [nr] = (call),

arch/riscv/kernel/time.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <linux/clocksource.h>
88
#include <linux/delay.h>
99
#include <asm/sbi.h>
10+
#include <asm/processor.h>
1011

1112
unsigned long riscv_timebase;
1213
EXPORT_SYMBOL_GPL(riscv_timebase);

0 commit comments

Comments
 (0)