Re: [PATCH v3 1/8] x86, syscalls: Refactor SYSCALL_DEFINEx macros

From: Brian Gerst
Date: Fri Feb 28 2020 - 14:34:57 EST


On Fri, Feb 28, 2020 at 1:33 PM Andy Lutomirski <luto@xxxxxxxxxx> wrote:
>
> On Thu, Feb 27, 2020 at 5:28 AM Brian Gerst <brgerst@xxxxxxxxx> 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@xxxxxxxxx>
> > ---
>
>
>
> > -#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.

Yeah, after several iterations this ended up back in it's original
form other than whitespace changes. Personally I think the 80-column
hard limit is silly in this age of 4k widescreen monitors, and can
lead to some weird line breaks in certain cases, but that's still the
rule.

--
Brian Gerst