diff options
author | Keith Owens <kaos@ocs.com.au> | 2004-06-17 18:16:33 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-06-17 18:16:33 -0700 |
commit | afbeb90febc477c61f67afdb8030d18250107e63 (patch) | |
tree | 95617f2b87c90ef3eeb302572cab873fcdd27f74 /kernel | |
parent | 780fac4d92524f41b5fe8f2afc88a1e39cf585b2 (diff) | |
download | history-afbeb90febc477c61f67afdb8030d18250107e63.tar.gz |
[PATCH] contify some scheduler functions
Several scheduler macros only read from the task struct, mark them const.
It may help the compiler generate better code.
Signed-off-by: Keith Owens <kaos@ocs.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/exit.c | 6 | ||||
-rw-r--r-- | kernel/sched.c | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index 3a51fec0aabc14..9cb99b471d2e05 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -834,10 +834,10 @@ asmlinkage long sys_exit(int error_code) do_exit((error_code&0xff)<<8); } -task_t fastcall *next_thread(task_t *p) +task_t fastcall *next_thread(const task_t *p) { - struct pid_link *link = p->pids + PIDTYPE_TGID; - struct list_head *tmp, *head = &link->pidptr->task_list; + const struct pid_link *link = p->pids + PIDTYPE_TGID; + const struct list_head *tmp, *head = &link->pidptr->task_list; #ifdef CONFIG_SMP if (!p->sighand) diff --git a/kernel/sched.c b/kernel/sched.c index 10c2581f40fe6e..8f49ba1202c3a4 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -546,7 +546,7 @@ static inline void resched_task(task_t *p) * task_curr - is this task currently executing on a CPU? * @p: the task in question. */ -inline int task_curr(task_t *p) +inline int task_curr(const task_t *p) { return cpu_curr(task_cpu(p)) == p; } @@ -2658,7 +2658,7 @@ asmlinkage long sys_nice(int increment) * RT tasks are offset by -200. Normal tasks are centered * around 0, value goes from -16 to +15. */ -int task_prio(task_t *p) +int task_prio(const task_t *p) { return p->prio - MAX_RT_PRIO; } @@ -2667,7 +2667,7 @@ int task_prio(task_t *p) * task_nice - return the nice value of a given task. * @p: the task in question. */ -int task_nice(task_t *p) +int task_nice(const task_t *p) { return TASK_NICE(p); } |