Remove the redundant nested conditional check within the system call
exit path of el0_svc_common() to streamline the exit sequence.

When entering this fast-path block, CONFIG_DEBUG_RSEQ is guaranteed to be
disabled. Under this constraint, the code logic inside the block becomes
completely identical to the evaluation performed within
syscall_exit_to_user_mode_work(). Therefore, invoking the inline helper
directly achieves full logical equivalence while eliminating duplicate
code nesting.

No functional changes.

Cc: Mark Rutland <[email protected]>
Cc: Will Deacon <[email protected]>
Cc: Catalin Marinas <[email protected]>
Cc: Ada Couprie Diaz <[email protected]>
Signed-off-by: Jinjie Ruan <[email protected]>
---
 arch/arm64/kernel/syscall.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/arm64/kernel/syscall.c b/arch/arm64/kernel/syscall.c
index 5dd94bece929..74308b6df43b 100644
--- a/arch/arm64/kernel/syscall.c
+++ b/arch/arm64/kernel/syscall.c
@@ -121,9 +121,7 @@ static void el0_svc_common(struct pt_regs *regs, int scno, 
int sc_nr,
         * exit regardless, as the old entry assembly did.
         */
        if (!(unlikely(flags & _TIF_SYSCALL_WORK)) && 
!IS_ENABLED(CONFIG_DEBUG_RSEQ)) {
-               flags = read_thread_flags();
-               if (unlikely(flags & _TIF_SYSCALL_EXIT_WORK) || flags & 
_TIF_SINGLESTEP)
-                       syscall_exit_to_user_mode_work(regs);
+               syscall_exit_to_user_mode_work(regs);
                return;
        }
 
-- 
2.34.1


Reply via email to