diff options
author | Oleg Nesterov <oleg@tv-sign.ru> | 2006-09-29 02:00:49 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-29 09:18:17 -0700 |
commit | 57a6f51c4281aa3119975473c70dce0480d322bd (patch) | |
tree | 05d22c0c64fc9de38554b6aca24b021a81479975 /kernel | |
parent | 5fe1d75f34974046fffcca5e22fb8a7b42fded33 (diff) | |
download | op-kernel-dev-57a6f51c4281aa3119975473c70dce0480d322bd.zip op-kernel-dev-57a6f51c4281aa3119975473c70dce0480d322bd.tar.gz |
[PATCH] introduce is_rt_policy() helper
Imho, makes the code a bit easier to read.
Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sched.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index f9b3c6a..c3c718a 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; |