summaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
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