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 <svens@linux.ibm.com>
Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
This commit is contained in:
Sven Schnelle 2025-02-27 08:22:07 +01:00 committed by Vasily Gorbik
parent cbf367d5b0
commit 8751b6e9e4

View 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;
}