[<prev] [next>] [day] [month] [year] [list]
Message-ID: <5237491E.8080901@gmail.com>
Date: Tue, 17 Sep 2013 03:08:30 +0900
From: ERAMOTO Masaya <eramoto.masaya@...il.com>
To: John Stultz <john.stultz@...aro.org>,
Thomas Gleixner <tglx@...utronix.de>,
linux-kernel@...r.kernel.org
Subject: [PATCH] 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 <eramoto.masaya@...il.com>
---
kernel/time/clocksource.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index 50a8736..5b340a4 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -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);
}
/**
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists