[PATCH for-next] futex: deduplicate resched in futex_wake_op()

From: Pavel Begunkov
Date: Mon May 17 2021 - 09:30:31 EST


After pagefaulting in futex_wake_op() both branches do cond_resched()
before retry. Help to deduplicate it as many compilers can't cope with
it.

Signed-off-by: Pavel Begunkov <asml.silence@xxxxxxxxx>
---
kernel/futex.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/kernel/futex.c b/kernel/futex.c
index c98b825da9cf..54ed232b2553 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -1728,12 +1728,9 @@ futex_wake_op(u32 __user *uaddr1, unsigned int flags, u32 __user *uaddr2,
return ret;
}

- if (!(flags & FLAGS_SHARED)) {
- cond_resched();
- goto retry_private;
- }
-
cond_resched();
+ if (!(flags & FLAGS_SHARED))
+ goto retry_private;
goto retry;
}

--
2.31.1