Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

m68k: kernel: Add and use <asm/syscalls.h>

When building with W=1:

arch/m68k/kernel/sys_m68k.c:40:17: warning: no previous prototype for ‘sys_mmap2’ [-Wmissing-prototypes]
40 | asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
| ^~~~~~~~~
arch/m68k/kernel/sys_m68k.c:378:1: warning: no previous prototype for ‘sys_cacheflush’ [-Wmissing-prototypes]
378 | sys_cacheflush (unsigned long addr, int scope, int cache, unsigned long len)
| ^~~~~~~~~~~~~~
arch/m68k/kernel/sys_m68k.c:463:1: warning: no previous prototype for ‘sys_atomic_cmpxchg_32’ [-Wmissing-prototypes]
463 | sys_atomic_cmpxchg_32(unsigned long newval, int oldval, int d3, int d4, int d5,
| ^~~~~~~~~~~~~~~~~~~~~
arch/m68k/kernel/sys_m68k.c:564:16: warning: no previous prototype for ‘sys_getpagesize’ [-Wmissing-prototypes]
564 | asmlinkage int sys_getpagesize(void)
| ^~~~~~~~~~~~~~~
arch/m68k/kernel/sys_m68k.c:569:26: warning: no previous prototype for ‘sys_get_thread_area’ [-Wmissing-prototypes]
569 | asmlinkage unsigned long sys_get_thread_area(void)
| ^~~~~~~~~~~~~~~~~~~
arch/m68k/kernel/sys_m68k.c:574:16: warning: no previous prototype for ‘sys_set_thread_area’ [-Wmissing-prototypes]
574 | asmlinkage int sys_set_thread_area(unsigned long tp)
| ^~~~~~~~~~~~~~~~~~~
arch/m68k/kernel/sys_m68k.c:580:16: warning: no previous prototype for ‘sys_atomic_barrier’ [-Wmissing-prototypes]
580 | asmlinkage int sys_atomic_barrier(void)
| ^~~~~~~~~~~~~~~~~~

Fix this by introducing a new header file <asm/syscalls.h> for holding
the prototypes for m68k-specific syscalls, and including the generic
ones.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/80b721eeb499562cd5d49887b0eee10dd172c88d.1694613528.git.geert@linux-m68k.org

+20
+19
arch/m68k/include/asm/syscalls.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0-only */ 2 + #ifndef _ASM_M68K_SYSCALLS_H 3 + #define _ASM_M68K_SYSCALLS_H 4 + 5 + #include <linux/compiler_types.h> 6 + #include <linux/linkage.h> 7 + 8 + asmlinkage int sys_cacheflush(unsigned long addr, int scope, int cache, 9 + unsigned long len); 10 + asmlinkage int sys_atomic_cmpxchg_32(unsigned long newval, int oldval, int d3, 11 + int d4, int d5, unsigned long __user *mem); 12 + asmlinkage int sys_getpagesize(void); 13 + asmlinkage unsigned long sys_get_thread_area(void); 14 + asmlinkage int sys_set_thread_area(unsigned long tp); 15 + asmlinkage int sys_atomic_barrier(void); 16 + 17 + #include <asm-generic/syscalls.h> 18 + 19 + #endif /* _ASM_M68K_SYSCALLS_H */
+1
arch/m68k/kernel/sys_m68k.c
··· 27 27 #include <asm/cachectl.h> 28 28 #include <asm/traps.h> 29 29 #include <asm/page.h> 30 + #include <asm/syscalls.h> 30 31 #include <asm/unistd.h> 31 32 #include <asm/cacheflush.h> 32 33