Time: Clocksource: finish searching when clocksource_enqueue() found the inserting place.
PATCH 1/1 Time: Clocksource: finish searching when clocksource_enqueue() found the inserting place.
Hi,
clocksource_enqueue() do extra behavior in the sorted list as below:
* it compares all clocksources in the list even if found the inserting place.
* it copies to entry until finding there.
So fixed clocksource_enqueue() as below:
* it finishes to compare clocksource when found there.
* it copies to entry only when found there.
Signed-off-by ERAMOTO Masaya <[email protected]>
--- kernel/time/clocksource.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
kernel/time/clocksource.c +4 -2
@@ -700,9 +700,11 @@ static void clocksource_enqueue(struct clocksource *cs)list_for_each_entry (tmp, &clocksource_list, list)/* Keep track of the place, where to insert */ -if (tmp->rating >= cs->rating) +if (tmp->rating < cs->rating) { entry = &tmp->list; -list_add (&cs->list, entry); +break ; + } +list_add_tail (&cs->list, entry); }/**