summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorKeith Owens <kaos@ocs.com.au>2004-06-17 18:16:33 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-06-17 18:16:33 -0700
commitafbeb90febc477c61f67afdb8030d18250107e63 (patch)
tree95617f2b87c90ef3eeb302572cab873fcdd27f74 /include/linux
parent780fac4d92524f41b5fe8f2afc88a1e39cf585b2 (diff)
[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 'include/linux')
-rw-r--r--include/linux/sched.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 0265d18570f9..630cc8f5dc6c 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -688,9 +688,9 @@ extern void sched_balance_exec(void);
extern void sched_idle_next(void);
extern void set_user_nice(task_t *p, long nice);
-extern int task_prio(task_t *p);
-extern int task_nice(task_t *p);
-extern int task_curr(task_t *p);
+extern int task_prio(const task_t *p);
+extern int task_nice(const task_t *p);
+extern int task_curr(const task_t *p);
extern int idle_cpu(int cpu);
void yield(void);
@@ -917,7 +917,7 @@ extern void wait_task_inactive(task_t * p);
#define while_each_thread(g, t) \
while ((t = next_thread(t)) != g)
-extern task_t * FASTCALL(next_thread(task_t *p));
+extern task_t * FASTCALL(next_thread(const task_t *p));
#define thread_group_leader(p) (p->pid == p->tgid)
@@ -1058,7 +1058,7 @@ extern void signal_wake_up(struct task_struct *t, int resume_stopped);
*/
#ifdef CONFIG_SMP
-static inline unsigned int task_cpu(struct task_struct *p)
+static inline unsigned int task_cpu(const struct task_struct *p)
{
return p->thread_info->cpu;
}
@@ -1070,7 +1070,7 @@ static inline void set_task_cpu(struct task_struct *p, unsigned int cpu)
#else
-static inline unsigned int task_cpu(struct task_struct *p)
+static inline unsigned int task_cpu(const struct task_struct *p)
{
return 0;
}