summaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-03-02 02:36:47 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-03-02 02:36:47 +0000
commit8624512aa908741ba2795200133eae0d7f4557ea (patch)
treed5d3036fccf2604f4c98dedc11e8adb929d6b52e /kernel/sched.c
parent7b8f5d6f1d45d9f9de1d26e7d3c32aa5af11b488 (diff)
Merge with 2.3.48.
Diffstat (limited to 'kernel/sched.c')
-rw-r--r--kernel/sched.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 1ccc6826c..bec8a4494 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -497,17 +497,15 @@ repeat_schedule:
c = -1000;
if (prev->state == TASK_RUNNING)
goto still_running;
-still_running_back:
- tmp = runqueue_head.next;
- while (tmp != &runqueue_head) {
+still_running_back:
+ list_for_each(tmp, &runqueue_head) {
p = list_entry(tmp, struct task_struct, run_list);
if (can_schedule(p)) {
int weight = goodness(p, this_cpu, prev->active_mm);
if (weight > c)
c = weight, next = p;
}
- tmp = tmp->next;
}
/* Do we need to re-calculate counters? */
@@ -658,13 +656,10 @@ static inline void __wake_up_common(wait_queue_head_t *q, unsigned int mode, con
if (!head->next || !head->prev)
WQ_BUG();
#endif
- tmp = head->next;
- while (tmp != head) {
+ list_for_each(tmp, head) {
unsigned int state;
wait_queue_t *curr = list_entry(tmp, wait_queue_t, task_list);
- tmp = tmp->next;
-
#if WAITQUEUE_DEBUG
CHECK_MAGIC(curr->__magic);
#endif