From: Sven Schnelle Date: Thu, 27 Feb 2025 07:22:07 +0000 (+0100) Subject: s390/syscall: Simplify syscall_get_arguments() X-Git-Tag: v6.15-rc1~113^2~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8751b6e9e4abf3603b567e871768eb8cca8ef91a;p=thirdparty%2Fkernel%2Flinux.git s390/syscall: Simplify syscall_get_arguments() Replace the while loop and if statement with a simple for loop to make the code easier to understand. Signed-off-by: Sven Schnelle Reviewed-by: Heiko Carstens Signed-off-by: Vasily Gorbik --- diff --git a/arch/s390/include/asm/syscall.h b/arch/s390/include/asm/syscall.h index 27e3d804b3117..0213ec800b576 100644 --- a/arch/s390/include/asm/syscall.h +++ b/arch/s390/include/asm/syscall.h @@ -65,15 +65,13 @@ static inline void syscall_get_arguments(struct task_struct *task, unsigned long *args) { unsigned long mask = -1UL; - unsigned int n = 6; #ifdef CONFIG_COMPAT if (test_tsk_thread_flag(task, TIF_31BIT)) mask = 0xffffffff; #endif - while (n-- > 0) - if (n > 0) - args[n] = regs->gprs[2 + n] & mask; + for (int i = 1; i < 6; i++) + args[i] = regs->gprs[2 + i] & mask; args[0] = regs->orig_gpr2 & mask; }