mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
[PATCH] introduce is_rt_policy() helper
Imho, makes the code a bit easier to read. Signed-off-by: Oleg Nesterov <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Steven Rostedt <[email protected]> Cc: Nick Piggin <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
5fe1d75f34
commit
57a6f51c42
2 changed files with 4 additions and 5 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue