diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sched.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index b81ed8703f70..850bde4b31a2 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -4619,8 +4619,10 @@ asmlinkage long sys_sched_yield(void) | |||
4619 | 4619 | ||
4620 | static inline int __resched_legal(int expected_preempt_count) | 4620 | static inline int __resched_legal(int expected_preempt_count) |
4621 | { | 4621 | { |
4622 | #ifdef CONFIG_PREEMPT | ||
4622 | if (unlikely(preempt_count() != expected_preempt_count)) | 4623 | if (unlikely(preempt_count() != expected_preempt_count)) |
4623 | return 0; | 4624 | return 0; |
4625 | #endif | ||
4624 | if (unlikely(system_state != SYSTEM_RUNNING)) | 4626 | if (unlikely(system_state != SYSTEM_RUNNING)) |
4625 | return 0; | 4627 | return 0; |
4626 | return 1; | 4628 | return 1; |