* [PATCH] arm64/syscall: Remove duplicate declaration
@ 2023-11-09 10:19 Kevin Brodsky
2023-11-09 13:47 ` Kevin Brodsky
0 siblings, 1 reply; 2+ messages in thread
From: Kevin Brodsky @ 2023-11-09 10:19 UTC (permalink / raw)
To: linux-arm-kernel
Cc: linux-kernel, Catalin Marinas, Arnd Bergmann, Kees Cook,
Ard Biesheuvel, Kevin Brodsky
Commit 6ac19f96515e ("arm64: avoid prototype warnings for syscalls")
added missing declarations to various syscall wrapper macros.
It however proved a little too zealous in __SYSCALL_DEFINEx(), as
a declaration for __arm64_sys##name was already present.
This likely wouldn't have happened if declarations were consistently
located, ideally just before the corresponding definition.
Accordingly, this patch removes the old declaration line in
__SYSCALL_DEFINEx(), and moves any other declaration that does not
directly precede the corresponding definition.
Signed-off-by: Kevin Brodsky <kevin.brodsky@arm.com>
---
arch/arm64/include/asm/syscall_wrapper.h | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/arch/arm64/include/asm/syscall_wrapper.h b/arch/arm64/include/asm/syscall_wrapper.h
index 17f687510c48..0d1ec3280f89 100644
--- a/arch/arm64/include/asm/syscall_wrapper.h
+++ b/arch/arm64/include/asm/syscall_wrapper.h
@@ -18,10 +18,10 @@
#ifdef CONFIG_COMPAT
#define COMPAT_SYSCALL_DEFINEx(x, name, ...) \
- asmlinkage long __arm64_compat_sys##name(const struct pt_regs *regs); \
ALLOW_ERROR_INJECTION(__arm64_compat_sys##name, ERRNO); \
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__)); \
+ asmlinkage long __arm64_compat_sys##name(const struct pt_regs *regs); \
asmlinkage long __arm64_compat_sys##name(const struct pt_regs *regs) \
{ \
return __se_compat_sys##name(SC_ARM64_REGS_TO_ARGS(x,__VA_ARGS__)); \
@@ -50,7 +50,6 @@
#endif /* CONFIG_COMPAT */
#define __SYSCALL_DEFINEx(x, name, ...) \
- asmlinkage long __arm64_sys##name(const struct pt_regs *regs); \
ALLOW_ERROR_INJECTION(__arm64_sys##name, ERRNO); \
static long __se_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__)); \
static inline long __do_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)); \
@@ -70,8 +69,8 @@
#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); \
asmlinkage long __arm64_sys_##sname(const struct pt_regs *__unused)
#define COND_SYSCALL(name) \
--
2.42.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] arm64/syscall: Remove duplicate declaration
2023-11-09 10:19 [PATCH] arm64/syscall: Remove duplicate declaration Kevin Brodsky
@ 2023-11-09 13:47 ` Kevin Brodsky
0 siblings, 0 replies; 2+ messages in thread
From: Kevin Brodsky @ 2023-11-09 13:47 UTC (permalink / raw)
To: linux-arm-kernel
Cc: linux-kernel, Catalin Marinas, Arnd Bergmann, Kees Cook, Ard Biesheuvel
On 09/11/2023 11:19, Kevin Brodsky wrote:
> Commit 6ac19f96515e ("arm64: avoid prototype warnings for syscalls")
> added missing declarations to various syscall wrapper macros.
> It however proved a little too zealous in __SYSCALL_DEFINEx(), as
> a declaration for __arm64_sys##name was already present.
>
> This likely wouldn't have happened if declarations were consistently
> located, ideally just before the corresponding definition.
> Accordingly, this patch removes the old declaration line in
> __SYSCALL_DEFINEx(), and moves any other declaration that does not
> directly precede the corresponding definition.
>
> Signed-off-by: Kevin Brodsky <kevin.brodsky@arm.com>
> ---
> arch/arm64/include/asm/syscall_wrapper.h | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm64/include/asm/syscall_wrapper.h b/arch/arm64/include/asm/syscall_wrapper.h
> index 17f687510c48..0d1ec3280f89 100644
> --- a/arch/arm64/include/asm/syscall_wrapper.h
> +++ b/arch/arm64/include/asm/syscall_wrapper.h
> @@ -18,10 +18,10 @@
> #ifdef CONFIG_COMPAT
>
> #define COMPAT_SYSCALL_DEFINEx(x, name, ...) \
> - asmlinkage long __arm64_compat_sys##name(const struct pt_regs *regs); \
> ALLOW_ERROR_INJECTION(__arm64_compat_sys##name, ERRNO); \
> 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__)); \
> + asmlinkage long __arm64_compat_sys##name(const struct pt_regs *regs); \
This doesn't make sense, the declaration needs to stay before the call
to ALLOW_ERROR_INJECTION() (I wasn't building with
CONFIG_FUNCTION_ERROR_INJECTION). Will post a v2 that simply removes the
added declaration in __SYSCALL_DEFINEx() without moving existing
declarations - sorry for the noise.
Kevin
> asmlinkage long __arm64_compat_sys##name(const struct pt_regs *regs) \
> { \
> return __se_compat_sys##name(SC_ARM64_REGS_TO_ARGS(x,__VA_ARGS__)); \
> @@ -50,7 +50,6 @@
> #endif /* CONFIG_COMPAT */
>
> #define __SYSCALL_DEFINEx(x, name, ...) \
> - asmlinkage long __arm64_sys##name(const struct pt_regs *regs); \
> ALLOW_ERROR_INJECTION(__arm64_sys##name, ERRNO); \
> static long __se_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__)); \
> static inline long __do_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)); \
> @@ -70,8 +69,8 @@
>
> #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); \
> asmlinkage long __arm64_sys_##sname(const struct pt_regs *__unused)
>
> #define COND_SYSCALL(name) \
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-11-09 13:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-09 10:19 [PATCH] arm64/syscall: Remove duplicate declaration Kevin Brodsky
2023-11-09 13:47 ` Kevin Brodsky
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®