Commit f1044799 authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Ingo Molnar

sched/fair: Clean up the __clear_buddies_*() functions

Slightly easier code flow, no functional changes.
Signed-off-by: default avatarPeter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1328936700.2476.17.camel@laptopSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 606dba2e
...@@ -2739,10 +2739,10 @@ static void __clear_buddies_last(struct sched_entity *se) ...@@ -2739,10 +2739,10 @@ static void __clear_buddies_last(struct sched_entity *se)
{ {
for_each_sched_entity(se) { for_each_sched_entity(se) {
struct cfs_rq *cfs_rq = cfs_rq_of(se); struct cfs_rq *cfs_rq = cfs_rq_of(se);
if (cfs_rq->last == se) if (cfs_rq->last != se)
cfs_rq->last = NULL;
else
break; break;
cfs_rq->last = NULL;
} }
} }
...@@ -2750,10 +2750,10 @@ static void __clear_buddies_next(struct sched_entity *se) ...@@ -2750,10 +2750,10 @@ static void __clear_buddies_next(struct sched_entity *se)
{ {
for_each_sched_entity(se) { for_each_sched_entity(se) {
struct cfs_rq *cfs_rq = cfs_rq_of(se); struct cfs_rq *cfs_rq = cfs_rq_of(se);
if (cfs_rq->next == se) if (cfs_rq->next != se)
cfs_rq->next = NULL;
else
break; break;
cfs_rq->next = NULL;
} }
} }
...@@ -2761,10 +2761,10 @@ static void __clear_buddies_skip(struct sched_entity *se) ...@@ -2761,10 +2761,10 @@ static void __clear_buddies_skip(struct sched_entity *se)
{ {
for_each_sched_entity(se) { for_each_sched_entity(se) {
struct cfs_rq *cfs_rq = cfs_rq_of(se); struct cfs_rq *cfs_rq = cfs_rq_of(se);
if (cfs_rq->skip == se) if (cfs_rq->skip != se)
cfs_rq->skip = NULL;
else
break; break;
cfs_rq->skip = NULL;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment