lkml.org 
[lkml]   [2020]   [Feb]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v3 1/8] x86, syscalls: Refactor SYSCALL_DEFINEx macros
On Thu, Feb 27, 2020 at 5:28 AM Brian Gerst <brgerst@gmail.com> wrote:
>
> Pull the common code out from the SYSCALL_DEFINEx macros into a new
> __SYS_STUBx macro. Also conditionalize the X64 version in preparation for
> enabling syscall wrappers on 32-bit native kernels.
>
> Signed-off-by: Brian Gerst <brgerst@gmail.com>
> ---



> -#define COMPAT_SYSCALL_DEFINEx(x, name, ...) \
> - static long __se_compat_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__)); \
> - static inline long __do_compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__));\
> - __IA32_COMPAT_SYS_STUBx(x, name, __VA_ARGS__) \
> - __X32_COMPAT_SYS_STUBx(x, name, __VA_ARGS__) \
> - static long __se_compat_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__)) \
> - { \
> - return __do_compat_sys##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__));\
> - } \
> - static inline long __do_compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))
> +#define COMPAT_SYSCALL_DEFINEx(x, name, ...) \
> + static long \
> + __se_compat_sys##name(__MAP(x, __SC_LONG, __VA_ARGS__)); \
> + static inline long \
> + __do_compat_sys##name(__MAP(x, __SC_DECL, __VA_ARGS__)); \
> + __IA32_COMPAT_SYS_STUBx(x, name, __VA_ARGS__) \
> + __X32_COMPAT_SYS_STUBx(x, name, __VA_ARGS__) \
> + static long \
> + __se_compat_sys##name(__MAP(x, __SC_LONG, __VA_ARGS__)) \
> + { \
> + return __do_compat_sys##name( \
> + __MAP(x, __SC_DELOUSE, __VA_ARGS__)); \
> + } \
> + static inline long \
> + __do_compat_sys##name(__MAP(x, __SC_DECL, __VA_ARGS__))
>

This hunk looks like a pure anti-cleanup. I much prefer slightly long
lines over messy excessively multi-line macros.

Other than that:

Reviewed-by: Andy Lutomirski <luto@kernel.org>

--Andy

\
 
 \ /
  Last update: 2020-02-28 19:35    [W:0.093 / U:1.404 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site