preempt_schedule() and preempt_schedule_context() open code their preemptability checks. Use the standard API instead for consolidation.
Showing the changes to kernel/context_tracking.c (1 of 2 files). Show all
Unified · Split
| @@ -87,10 +87,9 @@ void user_enter(void) · 86 unmodified lines | |||
| 87 | */ | 87 | */ |
| 88 | void __sched notrace preempt_schedule_context(void) | 88 | void __sched notrace preempt_schedule_context(void) |
| 89 | { | 89 | { |
| 90 | struct thread_info *ti = current_thread_info(); | ||
| 91 | enum ctx_state prev_ctx; | 90 | enum ctx_state prev_ctx; |
| 92 | 91 | ||
| 93 | if (likely(ti->preempt_count || irqs_disabled())) | 92 | if (likely(!preemptible())) |
| 94 | return; | 93 | return; |
| 95 | 94 | ||
| 96 | /* | 95 | /* |