]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
s390/syscall: Simplify syscall_get_arguments()
authorSven Schnelle <svens@linux.ibm.com>
Thu, 27 Feb 2025 07:22:07 +0000 (08:22 +0100)
committerVasily Gorbik <gor@linux.ibm.com>
Tue, 11 Mar 2025 14:28:58 +0000 (15:28 +0100)
Replace the while loop and if statement with a simple for loop
to make the code easier to understand.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/include/asm/syscall.h

index 27e3d804b311786a7c4cff02794527f4fb4778e8..0213ec800b5767cecb4ec8a2681163b4d3df10c1 100644 (file)
@@ -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;
 }