Commit 8751b6e9 authored by Sven Schnelle's avatar Sven Schnelle Committed by Vasily Gorbik
Browse files

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: default avatarSven Schnelle <svens@linux.ibm.com>
Reviewed-by: default avatarHeiko Carstens <hca@linux.ibm.com>
Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
parent cbf367d5
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -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;
}