提交 7f852afe 编写于 作者: B Baolin Wang 提交者: Thomas Gleixner

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: NBaolin Wang <baolin.wang@linaro.org>
Signed-off-by: NThomas 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
上级 4a3928c6
...@@ -594,6 +594,9 @@ static void __clocksource_select(bool skipcur) ...@@ -594,6 +594,9 @@ static void __clocksource_select(bool skipcur)
if (!best) if (!best)
return; return;
if (!strlen(override_name))
goto found;
/* Check for the override clocksource. */ /* Check for the override clocksource. */
list_for_each_entry(cs, &clocksource_list, list) { list_for_each_entry(cs, &clocksource_list, list) {
if (skipcur && cs == curr_clocksource) if (skipcur && cs == curr_clocksource)
...@@ -625,6 +628,7 @@ static void __clocksource_select(bool skipcur) ...@@ -625,6 +628,7 @@ static void __clocksource_select(bool skipcur)
break; break;
} }
found:
if (curr_clocksource != best && !timekeeping_notify(best)) { if (curr_clocksource != best && !timekeeping_notify(best)) {
pr_info("Switched to clocksource %s\n", best->name); pr_info("Switched to clocksource %s\n", best->name);
curr_clocksource = best; curr_clocksource = best;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册