arm64: simplify syscall wrapper ifdeffery
authorMark Rutland <mark.rutland@arm.com>
Fri, 13 Sep 2019 12:55:50 +0000 (13:55 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Mon, 14 Oct 2019 09:55:00 +0000 (10:55 +0100)
Back in commit:

  4378a7d4be30ec69 ("arm64: implement syscall wrappers")

... I implemented the arm64 syscall wrapper glue following the approach
taken on x86. While doing so, I also copied across some ifdeffery that
isn't necessary on arm64.

On arm64 we don't share any of the native wrappers with compat tasks,
and unlike x86 we don't have alternative implementations of
SYSCALL_DEFINE0(), COND_SYSCALL(), or SYS_NI() defined when AArch32
compat support is enabled.

Thus we don't need to prevent multiple definitions of these macros, and
can remove the #ifndef ... #endif guards protecting them. If any of
these had been previously defined elsewhere, syscalls are unlikely to
work correctly, and we'd want the compiler to warn about the multiple
definitions.

Acked-by: Will Deacon <will@kernel.org>
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/include/asm/syscall_wrapper.h

index 06d880b3526c3a3f9cf8d2c8bfd8a34a0b9403b0..b383b4802a7bdcf1b5851377529a03ef1b5bf536 100644 (file)
@@ -66,24 +66,18 @@ struct pt_regs;
        }                                                                       \
        static inline long __do_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))
 
-#ifndef SYSCALL_DEFINE0
 #define SYSCALL_DEFINE0(sname)                                                 \
        SYSCALL_METADATA(_##sname, 0);                                          \
        asmlinkage long __arm64_sys_##sname(const struct pt_regs *__unused);    \
        ALLOW_ERROR_INJECTION(__arm64_sys_##sname, ERRNO);                      \
        asmlinkage long __arm64_sys_##sname(const struct pt_regs *__unused)
-#endif
 
-#ifndef COND_SYSCALL
 #define COND_SYSCALL(name)                                                     \
        asmlinkage long __weak __arm64_sys_##name(const struct pt_regs *regs)   \
        {                                                                       \
                return sys_ni_syscall();                                        \
        }
-#endif
 
-#ifndef SYS_NI
 #define SYS_NI(name) SYSCALL_ALIAS(__arm64_sys_##name, sys_ni_posix_timers);
-#endif
 
 #endif /* __ASM_SYSCALL_WRAPPER_H */