Skip to content

Commit 8751b6e

Browse files
svens-s390Vasily Gorbik
authored andcommitted
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 <[email protected]> Reviewed-by: Heiko Carstens <[email protected]> Signed-off-by: Vasily Gorbik <[email protected]>
1 parent cbf367d commit 8751b6e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

arch/s390/include/asm/syscall.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,13 @@ static inline void syscall_get_arguments(struct task_struct *task,
6565
unsigned long *args)
6666
{
6767
unsigned long mask = -1UL;
68-
unsigned int n = 6;
6968

7069
#ifdef CONFIG_COMPAT
7170
if (test_tsk_thread_flag(task, TIF_31BIT))
7271
mask = 0xffffffff;
7372
#endif
74-
while (n-- > 0)
75-
if (n > 0)
76-
args[n] = regs->gprs[2 + n] & mask;
73+
for (int i = 1; i < 6; i++)
74+
args[i] = regs->gprs[2 + i] & mask;
7775

7876
args[0] = regs->orig_gpr2 & mask;
7977
}

0 commit comments

Comments
 (0)