[PATCH v11 01/14] entry: Remove unused syscall in syscall_trace_enter()

Jinjie Ruan posted 14 patches 1 week, 5 days ago
There is a newer version of this series
[PATCH v11 01/14] entry: Remove unused syscall in syscall_trace_enter()
Posted by Jinjie Ruan 1 week, 5 days ago
The 'syscall' argument in syscall_trace_enter() is immediately overwritten
before any real use and serves only as a local variable, so drop
the parameter.

No functional change intended.

Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
---
 include/linux/entry-common.h  | 4 ++--
 kernel/entry/syscall-common.c | 5 ++---
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/include/linux/entry-common.h b/include/linux/entry-common.h
index 87efb38b7081..e4a8287af822 100644
--- a/include/linux/entry-common.h
+++ b/include/linux/entry-common.h
@@ -45,7 +45,7 @@
 				 SYSCALL_WORK_SYSCALL_EXIT_TRAP	|	\
 				 ARCH_SYSCALL_WORK_EXIT)
 
-long syscall_trace_enter(struct pt_regs *regs, long syscall, unsigned long work);
+long syscall_trace_enter(struct pt_regs *regs, unsigned long work);
 
 /**
  * syscall_enter_from_user_mode_work - Check and handle work before invoking
@@ -75,7 +75,7 @@ static __always_inline long syscall_enter_from_user_mode_work(struct pt_regs *re
 	unsigned long work = READ_ONCE(current_thread_info()->syscall_work);
 
 	if (work & SYSCALL_WORK_ENTER)
-		syscall = syscall_trace_enter(regs, syscall, work);
+		syscall = syscall_trace_enter(regs, work);
 
 	return syscall;
 }
diff --git a/kernel/entry/syscall-common.c b/kernel/entry/syscall-common.c
index 940a597ded40..e6237b536d8b 100644
--- a/kernel/entry/syscall-common.c
+++ b/kernel/entry/syscall-common.c
@@ -17,10 +17,9 @@ static inline void syscall_enter_audit(struct pt_regs *regs, long syscall)
 	}
 }
 
-long syscall_trace_enter(struct pt_regs *regs, long syscall,
-				unsigned long work)
+long syscall_trace_enter(struct pt_regs *regs, unsigned long work)
 {
-	long ret = 0;
+	long syscall, ret = 0;
 
 	/*
 	 * Handle Syscall User Dispatch.  This must comes first, since
-- 
2.34.1
Re: [PATCH v11 01/14] entry: Remove unused syscall in syscall_trace_enter()
Posted by Thomas Gleixner 1 week, 3 days ago
On Wed, Jan 28 2026 at 11:19, Jinjie Ruan wrote:
> The 'syscall' argument in syscall_trace_enter() is immediately overwritten
> before any real use and serves only as a local variable, so drop
> the parameter.

This collides with the already queued time slice extension changes,
which rely on syscall to be handed in:

https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?h=sched/core&id=dd0a04606937af5810e9117d343ee3792635bd3d

Please drop this for now.

Thanks,

        tglx
Re: [PATCH v11 01/14] entry: Remove unused syscall in syscall_trace_enter()
Posted by Kevin Brodsky 1 week, 4 days ago
On 28/01/2026 04:19, Jinjie Ruan wrote:
> The 'syscall' argument in syscall_trace_enter() is immediately overwritten
> before any real use and serves only as a local variable, so drop
> the parameter.
>
> No functional change intended.
>
> Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>

In commit title: s/syscall/parameter/ (very confusing otherwise!)

With that fixed:

Reviewed-by: Kevin Brodsky <kevin.brodsky@arm.com>

> ---
>  include/linux/entry-common.h  | 4 ++--
>  kernel/entry/syscall-common.c | 5 ++---
>  2 files changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/include/linux/entry-common.h b/include/linux/entry-common.h
> index 87efb38b7081..e4a8287af822 100644
> --- a/include/linux/entry-common.h
> +++ b/include/linux/entry-common.h
> @@ -45,7 +45,7 @@
>  				 SYSCALL_WORK_SYSCALL_EXIT_TRAP	|	\
>  				 ARCH_SYSCALL_WORK_EXIT)
>  
> -long syscall_trace_enter(struct pt_regs *regs, long syscall, unsigned long work);
> +long syscall_trace_enter(struct pt_regs *regs, unsigned long work);
>  
>  /**
>   * syscall_enter_from_user_mode_work - Check and handle work before invoking
> @@ -75,7 +75,7 @@ static __always_inline long syscall_enter_from_user_mode_work(struct pt_regs *re
>  	unsigned long work = READ_ONCE(current_thread_info()->syscall_work);
>  
>  	if (work & SYSCALL_WORK_ENTER)
> -		syscall = syscall_trace_enter(regs, syscall, work);
> +		syscall = syscall_trace_enter(regs, work);
>  
>  	return syscall;
>  }
> diff --git a/kernel/entry/syscall-common.c b/kernel/entry/syscall-common.c
> index 940a597ded40..e6237b536d8b 100644
> --- a/kernel/entry/syscall-common.c
> +++ b/kernel/entry/syscall-common.c
> @@ -17,10 +17,9 @@ static inline void syscall_enter_audit(struct pt_regs *regs, long syscall)
>  	}
>  }
>  
> -long syscall_trace_enter(struct pt_regs *regs, long syscall,
> -				unsigned long work)
> +long syscall_trace_enter(struct pt_regs *regs, unsigned long work)
>  {
> -	long ret = 0;
> +	long syscall, ret = 0;
>  
>  	/*
>  	 * Handle Syscall User Dispatch.  This must comes first, since
[tip: core/entry] entry: Remove unused syscall argument from syscall_trace_enter()
Posted by tip-bot2 for Jinjie Ruan 1 week, 2 days ago
The following commit has been merged into the core/entry branch of tip:

Commit-ID:     03150a9f84b328f5c724b8ed9ff8600c2d7e2d7b
Gitweb:        https://git.kernel.org/tip/03150a9f84b328f5c724b8ed9ff8600c2d7e2d7b
Author:        Jinjie Ruan <ruanjinjie@huawei.com>
AuthorDate:    Wed, 28 Jan 2026 11:19:21 +08:00
Committer:     Thomas Gleixner <tglx@kernel.org>
CommitterDate: Fri, 30 Jan 2026 15:38:09 +01:00

entry: Remove unused syscall argument from syscall_trace_enter()

The 'syscall' argument of syscall_trace_enter() is immediately overwritten
before any real use and serves only as a local variable, so drop the
parameter.

No functional change intended.

Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Link: https://patch.msgid.link/20260128031934.3906955-2-ruanjinjie@huawei.com
---
 include/linux/entry-common.h  | 4 ++--
 kernel/entry/syscall-common.c | 5 ++---
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/include/linux/entry-common.h b/include/linux/entry-common.h
index 87efb38..e4a8287 100644
--- a/include/linux/entry-common.h
+++ b/include/linux/entry-common.h
@@ -45,7 +45,7 @@
 				 SYSCALL_WORK_SYSCALL_EXIT_TRAP	|	\
 				 ARCH_SYSCALL_WORK_EXIT)
 
-long syscall_trace_enter(struct pt_regs *regs, long syscall, unsigned long work);
+long syscall_trace_enter(struct pt_regs *regs, unsigned long work);
 
 /**
  * syscall_enter_from_user_mode_work - Check and handle work before invoking
@@ -75,7 +75,7 @@ static __always_inline long syscall_enter_from_user_mode_work(struct pt_regs *re
 	unsigned long work = READ_ONCE(current_thread_info()->syscall_work);
 
 	if (work & SYSCALL_WORK_ENTER)
-		syscall = syscall_trace_enter(regs, syscall, work);
+		syscall = syscall_trace_enter(regs, work);
 
 	return syscall;
 }
diff --git a/kernel/entry/syscall-common.c b/kernel/entry/syscall-common.c
index 940a597..e6237b5 100644
--- a/kernel/entry/syscall-common.c
+++ b/kernel/entry/syscall-common.c
@@ -17,10 +17,9 @@ static inline void syscall_enter_audit(struct pt_regs *regs, long syscall)
 	}
 }
 
-long syscall_trace_enter(struct pt_regs *regs, long syscall,
-				unsigned long work)
+long syscall_trace_enter(struct pt_regs *regs, unsigned long work)
 {
-	long ret = 0;
+	long syscall, ret = 0;
 
 	/*
 	 * Handle Syscall User Dispatch.  This must comes first, since