[RFC][PATCH 1/2] syscalls.h: Make SyS_foo() declaration static

From: Steven Rostedt
Date: Wed May 06 2015 - 14:24:15 EST


From: "Steven Rostedt (Red Hat)" <rostedt@xxxxxxxxxxx>

Nothing should call the syscall wrapper alias (SyS_foo) directly.
It is only used to force the system call to sign extend its arguments.
See commit 1a94bc34768e "System call wrapper infrastructure".

By declaring it static, we can also remove the protoype that was
added by commit f9597f24c089 "syscalls.h: add forward declarations for
inplace syscall wrappers", that fixed the warnings that were generated
because the call was not static.

Cc: Christian Borntraeger <borntraeger@xxxxxxxxxx>
Cc: Martin Schwidefsky <schwidefsky@xxxxxxxxxx>
Cc: Heiko Carstens <heiko.carstens@xxxxxxxxxx>
Cc: Sergei Trofimovich <slyfox@xxxxxxxxxx>
Cc: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
Signed-off-by: Steven Rostedt <rostedt@xxxxxxxxxxx>
---
include/linux/syscalls.h | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 76d1e38aabe1..f8e5b696670c 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -195,8 +195,7 @@ extern struct trace_event_functions exit_syscall_print_funcs;
asmlinkage long sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) \
__attribute__((alias(__stringify(SyS##name)))); \
static inline long SYSC##name(__MAP(x,__SC_DECL,__VA_ARGS__)); \
- asmlinkage long SyS##name(__MAP(x,__SC_LONG,__VA_ARGS__)); \
- asmlinkage long SyS##name(__MAP(x,__SC_LONG,__VA_ARGS__)) \
+ asmlinkage static long SyS##name(__MAP(x,__SC_LONG,__VA_ARGS__)) \
{ \
long ret = SYSC##name(__MAP(x,__SC_CAST,__VA_ARGS__)); \
__MAP(x,__SC_TEST,__VA_ARGS__); \
--
2.1.4


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/