From afbeb90febc477c61f67afdb8030d18250107e63 Mon Sep 17 00:00:00 2001 From: Keith Owens Date: Thu, 17 Jun 2004 18:16:33 -0700 Subject: [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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- kernel/exit.c | 6 +++--- kernel/sched.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'kernel') diff --git a/kernel/exit.c b/kernel/exit.c index 3a51fec0aabc..9cb99b471d2e 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 10c2581f40fe..8f49ba1202c3 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); } -- cgit v1.2.3