Skip to content

Commit 6ac19f9

Browse files
arndbctmarinas
authored andcommitted
arm64: avoid prototype warnings for syscalls
With W=1 warnings enabled, there are lots of complaints about missing prototypes for system calls, plus a few other related ones: arch/arm64/kernel/sys_compat.c:68:6: error: no previous prototype for 'compat_arm_syscall' [-Werror=missing-prototypes] arch/arm64/include/asm/syscall_wrapper.h:76:32: error: no previous prototype for '__arm64_sys_io_setup' [-Werror=missing-prototypes] arch/arm64/include/asm/syscall_wrapper.h:41:32: error: no previous prototype for '__arm64_compat_sys_io_setup' [-Werror=missing-prototypes] arch/arm64/include/asm/syscall_wrapper.h:76:32: error: no previous prototype for '__arm64_sys_io_destroy' [-Werror=missing-prototypes] arch/arm64/include/asm/syscall_wrapper.h:76:32: error: no previous prototype for '__arm64_sys_io_submit' [-Werror=missing-prototypes] Add declarations to the syscall macros to avoid all of these, plus one for the compat syscall entry. Signed-off-by: Arnd Bergmann <[email protected]> Reviewed-by: Kees Cook <[email protected]> Acked-by: Ard Biesheuvel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent aea1971 commit 6ac19f9

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

arch/arm64/include/asm/compat.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ static inline int is_compat_thread(struct thread_info *thread)
9696
return test_ti_thread_flag(thread, TIF_32BIT);
9797
}
9898

99+
long compat_arm_syscall(struct pt_regs *regs, int scno);
100+
99101
#else /* !CONFIG_COMPAT */
100102

101103
static inline int is_compat_thread(struct thread_info *thread)

arch/arm64/include/asm/syscall_wrapper.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
asmlinkage long __arm64_compat_sys_##sname(const struct pt_regs *__unused)
3939

4040
#define COND_SYSCALL_COMPAT(name) \
41+
asmlinkage long __arm64_compat_sys_##name(const struct pt_regs *regs); \
4142
asmlinkage long __weak __arm64_compat_sys_##name(const struct pt_regs *regs) \
4243
{ \
4344
return sys_ni_syscall(); \
@@ -53,6 +54,7 @@
5354
ALLOW_ERROR_INJECTION(__arm64_sys##name, ERRNO); \
5455
static long __se_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__)); \
5556
static inline long __do_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)); \
57+
asmlinkage long __arm64_sys##name(const struct pt_regs *regs); \
5658
asmlinkage long __arm64_sys##name(const struct pt_regs *regs) \
5759
{ \
5860
return __se_sys##name(SC_ARM64_REGS_TO_ARGS(x,__VA_ARGS__)); \
@@ -73,11 +75,13 @@
7375
asmlinkage long __arm64_sys_##sname(const struct pt_regs *__unused)
7476

7577
#define COND_SYSCALL(name) \
78+
asmlinkage long __arm64_sys_##name(const struct pt_regs *regs); \
7679
asmlinkage long __weak __arm64_sys_##name(const struct pt_regs *regs) \
7780
{ \
7881
return sys_ni_syscall(); \
7982
}
8083

84+
asmlinkage long __arm64_sys_ni_syscall(const struct pt_regs *__unused);
8185
#define SYS_NI(name) SYSCALL_ALIAS(__arm64_sys_##name, sys_ni_posix_timers);
8286

8387
#endif /* __ASM_SYSCALL_WRAPPER_H */

0 commit comments

Comments
 (0)