aboutsummaryrefslogtreecommitdiff
path: root/kernel/sched.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sched.c')
-rw-r--r--kernel/sched.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index f9b3c6a414f..c3c718aea61 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -4109,8 +4109,7 @@ recheck:
(p->mm && param->sched_priority > MAX_USER_RT_PRIO-1) ||
(!p->mm && param->sched_priority > MAX_RT_PRIO-1))
return -EINVAL;
- if ((policy == SCHED_NORMAL || policy == SCHED_BATCH)
- != (param->sched_priority == 0))
+ if (is_rt_policy(policy) != (param->sched_priority != 0))
return -EINVAL;
/*
@@ -4134,7 +4133,7 @@ recheck:
!rlim_rtprio)
return -EPERM;
/* can't increase priority */
- if ((policy != SCHED_NORMAL && policy != SCHED_BATCH) &&
+ if (is_rt_policy(policy) &&
param->sched_priority > p->rt_priority &&
param->sched_priority > rlim_rtprio)
return -EPERM;