summaryrefslogtreecommitdiff
path: root/include/linux/compat.h
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-01-22 00:03:44 +0400
committerAl Viro <viro@zeniv.linux.org.uk>2013-03-04 07:46:21 +0400
commit07fe6e00f6cca6fef85a14a1dc3ed4f2e35d3f0b (patch)
treea3e4f9e97b298fd778f9bbab188322407d822473 /include/linux/compat.h
parent6dbe51c251a327e012439c4772097a13df43c5b8 (diff)
downloadlinux-07fe6e00f6cca6fef85a14a1dc3ed4f2e35d3f0b.tar.xz
get rid of duplicate logics in __SC_....[1-6] definitions
All those guys have the same form - "take a list of type/name pairs, apply some macro to each of them". Abstract that part away, convert all __SC_FOO##x(__VA_ARGS__) to __MAP(x,__SC_FOO,__VA_ARGS__). Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/linux/compat.h')
-rw-r--r--include/linux/compat.h18
1 files changed, 6 insertions, 12 deletions
diff --git a/include/linux/compat.h b/include/linux/compat.h
index 76a87fb57ac2..8c1dfc8d830d 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -27,12 +27,6 @@
#define __SC_DELOUSE(t,v) ((t)(unsigned long)(v))
#endif
-#define __SC_CCAST1(t1, a1) __SC_DELOUSE(t1,a1)
-#define __SC_CCAST2(t2, a2, ...) __SC_DELOUSE(t2,a2), __SC_CCAST1(__VA_ARGS__)
-#define __SC_CCAST3(t3, a3, ...) __SC_DELOUSE(t3,a3), __SC_CCAST2(__VA_ARGS__)
-#define __SC_CCAST4(t4, a4, ...) __SC_DELOUSE(t4,a4), __SC_CCAST3(__VA_ARGS__)
-#define __SC_CCAST5(t5, a5, ...) __SC_DELOUSE(t5,a5), __SC_CCAST4(__VA_ARGS__)
-#define __SC_CCAST6(t6, a6, ...) __SC_DELOUSE(t6,a6), __SC_CCAST5(__VA_ARGS__)
#define COMPAT_SYSCALL_DEFINE1(name, ...) \
COMPAT_SYSCALL_DEFINEx(1, _##name, __VA_ARGS__)
#define COMPAT_SYSCALL_DEFINE2(name, ...) \
@@ -49,19 +43,19 @@
#ifdef CONFIG_HAVE_SYSCALL_WRAPPERS
#define COMPAT_SYSCALL_DEFINEx(x, name, ...) \
- asmlinkage long compat_sys##name(__SC_DECL##x(__VA_ARGS__)); \
- static inline long C_SYSC##name(__SC_DECL##x(__VA_ARGS__)); \
- asmlinkage long compat_SyS##name(__SC_LONG##x(__VA_ARGS__)) \
+ asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__));\
+ static inline long C_SYSC##name(__MAP(x,__SC_DECL,__VA_ARGS__));\
+ asmlinkage long compat_SyS##name(__MAP(x,__SC_LONG,__VA_ARGS__))\
{ \
- return (long) C_SYSC##name(__SC_CCAST##x(__VA_ARGS__)); \
+ return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \
} \
SYSCALL_ALIAS(compat_sys##name, compat_SyS##name); \
- static inline long C_SYSC##name(__SC_DECL##x(__VA_ARGS__))
+ static inline long C_SYSC##name(__MAP(x,__SC_DECL,__VA_ARGS__))
#else /* CONFIG_HAVE_SYSCALL_WRAPPERS */
#define COMPAT_SYSCALL_DEFINEx(x, name, ...) \
- asmlinkage long compat_sys##name(__SC_DECL##x(__VA_ARGS__))
+ asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))
#endif /* CONFIG_HAVE_SYSCALL_WRAPPERS */