summaryrefslogtreecommitdiff
path: root/kernel/time/clocksource.c
diff options
context:
space:
mode:
authorBaolin Wang <baolin.wang@linaro.org>2018-01-17 09:01:28 +0300
committerThomas Gleixner <tglx@linutronix.de>2018-02-28 16:04:52 +0300
commit7f852afe448c95691ead6b57bae5f37562d060b5 (patch)
treec6a98558fa6517148c9eaf3bed6b0a6ba443baca /kernel/time/clocksource.c
parent4a3928c6f8a53fa1aed28ccba227742486e8ddcb (diff)
downloadlinux-7f852afe448c95691ead6b57bae5f37562d060b5.tar.xz
clocksource: Don't walk the clocksource list for empty override
If the override clocksource name is empty there is no point in walking the clocksource list for a match. Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: arnd@arndb.de Cc: sboyd@codeaurora.org Cc: broonie@kernel.org Cc: john.stultz@linaro.org Link: https://lkml.kernel.org/r/069ce2a605546bcad6552968cff755f0a03f9f10.1516167691.git.baolin.wang@linaro.org
Diffstat (limited to 'kernel/time/clocksource.c')
-rw-r--r--kernel/time/clocksource.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index 65f9e3f24dde..c5fdcb13200f 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -594,6 +594,9 @@ static void __clocksource_select(bool skipcur)
if (!best)
return;
+ if (!strlen(override_name))
+ goto found;
+
/* Check for the override clocksource. */
list_for_each_entry(cs, &clocksource_list, list) {
if (skipcur && cs == curr_clocksource)
@@ -625,6 +628,7 @@ static void __clocksource_select(bool skipcur)
break;
}
+found:
if (curr_clocksource != best && !timekeeping_notify(best)) {
pr_info("Switched to clocksource %s\n", best->name);
curr_clocksource = best;