]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
openrisc: Add missing prototypes for assembly called fnctions
authorStafford Horne <shorne@gmail.com>
Sun, 20 Aug 2023 08:28:19 +0000 (09:28 +0100)
committerStafford Horne <shorne@gmail.com>
Mon, 21 Aug 2023 07:11:54 +0000 (08:11 +0100)
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>
arch/openrisc/kernel/ptrace.c
arch/openrisc/kernel/signal.c
arch/openrisc/kernel/smp.c
arch/openrisc/kernel/time.c
arch/openrisc/kernel/traps.c
arch/openrisc/mm/fault.c

index 0b7d2ca6ba3b92b48ea700c1ceaa016a0bf02689..1eeac3b62e9d3ab075011c6b95b9563a373b8c79 100644 (file)
 #include <asm/thread_info.h>
 #include <asm/page.h>
 
+asmlinkage long do_syscall_trace_enter(struct pt_regs *regs);
+
+asmlinkage void do_syscall_trace_leave(struct pt_regs *regs);
+
 /*
  * Copy the thread state to a regset that can be interpreted by userspace.
  *
index 2e7257a433ff4f94a58c1562614b7e1e63b22f2c..3fbf003300430503ea5efe7e9c2f6d5781792541 100644 (file)
@@ -34,6 +34,11 @@ struct rt_sigframe {
        unsigned char retcode[16];      /* trampoline code */
 };
 
+asmlinkage long _sys_rt_sigreturn(struct pt_regs *regs);
+
+asmlinkage int do_work_pending(struct pt_regs *regs, unsigned int thread_flags,
+                              int syscall);
+
 static int restore_sigcontext(struct pt_regs *regs,
                              struct sigcontext __user *sc)
 {
index 0a7a059e2dff4d67e69fc6fa63d9469a51f53e13..1c5a2d71d6753e8a02a8903712c163802e56891c 100644 (file)
@@ -23,6 +23,8 @@
 #include <asm/cacheflush.h>
 #include <asm/time.h>
 
+asmlinkage __init void secondary_start_kernel(void);
+
 static void (*smp_cross_call)(const struct cpumask *, unsigned int);
 
 unsigned long secondary_release = -1;
index 8e26c1af544191857c830f35e07b574c59a307fd..764c7bfb5df34b1f9a59c839703f0aa019c48e53 100644 (file)
@@ -25,6 +25,8 @@
 #include <asm/cpuinfo.h>
 #include <asm/time.h>
 
+irqreturn_t __irq_entry timer_interrupt(struct pt_regs *regs);
+
 /* Test the timer ticks to count, used in sync routine */
 inline void openrisc_timer_set(unsigned long count)
 {
index 0aa6b07efda1b34cc2de4c2d181f001019be2d92..afa47501118facbd992771388b2ac037fd6a8b23 100644 (file)
@@ -38,6 +38,14 @@ static int kstack_depth_to_print = 0x180;
 int lwa_flag;
 static unsigned long __user *lwa_addr;
 
+asmlinkage void unhandled_exception(struct pt_regs *regs, int ea, int vector);
+asmlinkage void do_trap(struct pt_regs *regs, unsigned long address);
+asmlinkage void do_fpe_trap(struct pt_regs *regs, unsigned long address);
+asmlinkage void do_unaligned_access(struct pt_regs *regs, unsigned long address);
+asmlinkage void do_bus_fault(struct pt_regs *regs, unsigned long address);
+asmlinkage void do_illegal_instruction(struct pt_regs *regs,
+                                      unsigned long address);
+
 static void print_trace(void *data, unsigned long addr, int reliable)
 {
        const char *loglvl = data;
index a9dcd4381d1a11a7c62fa72ee358fb1cf4c5e852..01dc18aa8410f49a9abfa24a3420b5ebd4d85883 100644 (file)
@@ -32,6 +32,9 @@ volatile pgd_t *current_pgd[NR_CPUS];
 
 extern void __noreturn die(char *, struct pt_regs *, long);
 
+asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long address,
+                             unsigned long vector, int write_acc);
+
 /*
  * This routine handles page faults.  It determines the address,
  * and the problem, and then passes it off to one of the appropriate