Skip to content

Commit 1c4de49

Browse files
committed
openrisc: Add missing prototypes for assembly called fnctions
These functions are all called from assembly files so there is no need for a prototype in a header file, but when compiling with W=1 enabling -Wmissing-prototypes the compiler warns: arch/openrisc/kernel/ptrace.c:191:17: error: no previous prototype for 'do_syscall_trace_enter' [-Werror=missing-prototypes] arch/openrisc/kernel/ptrace.c:210:17: error: no previous prototype for 'do_syscall_trace_leave' [-Werror=missing-prototypes] arch/openrisc/kernel/signal.c:293:1: error: no previous prototype for 'do_work_pending' [-Werror=missing-prototypes] arch/openrisc/kernel/signal.c:68:17: error: no previous prototype for '_sys_rt_sigreturn' [-Werror=missing-prototypes] arch/openrisc/kernel/time.c:111:25: error: no previous prototype for 'timer_interrupt' [-Werror=missing-prototypes] arch/openrisc/kernel/traps.c:239:17: error: no previous prototype for 'unhandled_exception' [-Werror=missing-prototypes] arch/openrisc/kernel/traps.c:246:17: error: no previous prototype for 'do_fpe_trap' [-Werror=missing-prototypes] arch/openrisc/kernel/traps.c:268:17: error: no previous prototype for 'do_trap' [-Werror=missing-prototypes] arch/openrisc/kernel/traps.c:273:17: error: no previous prototype for 'do_unaligned_access' [-Werror=missing-prototypes] arch/openrisc/kernel/traps.c:286:17: error: no previous prototype for 'do_bus_fault' [-Werror=missing-prototypes] arch/openrisc/kernel/traps.c:462:17: error: no previous prototype for 'do_illegal_instruction' [-Werror=missing-prototypes] arch/openrisc/mm/fault.c:44:17: error: no previous prototype for 'do_page_fault' [-Werror=missing-prototypes] Since these are not needed in header files, fix these by adding prototypes to the top of the respective C files. Reported-by: Arnd Bergmann <arnd@arndb.de> Closes: https://lore.kernel.org/linux-kernel/20230810141947.1236730-17-arnd@kernel.org/ Signed-off-by: Stafford Horne <shorne@gmail.com>
1 parent 232ba16 commit 1c4de49

6 files changed

Lines changed: 24 additions & 0 deletions

File tree

arch/openrisc/kernel/ptrace.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727
#include <asm/thread_info.h>
2828
#include <asm/page.h>
2929

30+
asmlinkage long do_syscall_trace_enter(struct pt_regs *regs);
31+
32+
asmlinkage void do_syscall_trace_leave(struct pt_regs *regs);
33+
3034
/*
3135
* Copy the thread state to a regset that can be interpreted by userspace.
3236
*

arch/openrisc/kernel/signal.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ struct rt_sigframe {
3434
unsigned char retcode[16]; /* trampoline code */
3535
};
3636

37+
asmlinkage long _sys_rt_sigreturn(struct pt_regs *regs);
38+
39+
asmlinkage int do_work_pending(struct pt_regs *regs, unsigned int thread_flags,
40+
int syscall);
41+
3742
static int restore_sigcontext(struct pt_regs *regs,
3843
struct sigcontext __user *sc)
3944
{

arch/openrisc/kernel/smp.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
#include <asm/cacheflush.h>
2424
#include <asm/time.h>
2525

26+
asmlinkage __init void secondary_start_kernel(void);
27+
2628
static void (*smp_cross_call)(const struct cpumask *, unsigned int);
2729

2830
unsigned long secondary_release = -1;

arch/openrisc/kernel/time.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
#include <asm/cpuinfo.h>
2626
#include <asm/time.h>
2727

28+
irqreturn_t __irq_entry timer_interrupt(struct pt_regs *regs);
29+
2830
/* Test the timer ticks to count, used in sync routine */
2931
inline void openrisc_timer_set(unsigned long count)
3032
{

arch/openrisc/kernel/traps.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ static int kstack_depth_to_print = 0x180;
3838
int lwa_flag;
3939
static unsigned long __user *lwa_addr;
4040

41+
asmlinkage void unhandled_exception(struct pt_regs *regs, int ea, int vector);
42+
asmlinkage void do_trap(struct pt_regs *regs, unsigned long address);
43+
asmlinkage void do_fpe_trap(struct pt_regs *regs, unsigned long address);
44+
asmlinkage void do_unaligned_access(struct pt_regs *regs, unsigned long address);
45+
asmlinkage void do_bus_fault(struct pt_regs *regs, unsigned long address);
46+
asmlinkage void do_illegal_instruction(struct pt_regs *regs,
47+
unsigned long address);
48+
4149
static void print_trace(void *data, unsigned long addr, int reliable)
4250
{
4351
const char *loglvl = data;

arch/openrisc/mm/fault.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ volatile pgd_t *current_pgd[NR_CPUS];
3232

3333
extern void __noreturn die(char *, struct pt_regs *, long);
3434

35+
asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long address,
36+
unsigned long vector, int write_acc);
37+
3538
/*
3639
* This routine handles page faults. It determines the address,
3740
* and the problem, and then passes it off to one of the appropriate

0 commit comments

Comments
 (0)