mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: tip-bot for Baolin Wang <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, mingo@kernel.org, hpa@zytor.com,
	tglx@linutronix.de, baolin.wang@linaro.org
Subject: [tip:timers/core] clocksource: Don't walk the clocksource list for empty override
Date: Wed, 28 Feb 2018 05:09:49 -0800	[thread overview]
Message-ID: <tip-7f852afe448c95691ead6b57bae5f37562d060b5@git.kernel.org> (raw)
In-Reply-To: <069ce2a605546bcad6552968cff755f0a03f9f10.1516167691.git.baolin.wang@linaro.org>

Commit-ID:  7f852afe448c95691ead6b57bae5f37562d060b5
Gitweb:     https://git.kernel.org/tip/7f852afe448c95691ead6b57bae5f37562d060b5
Author:     Baolin Wang <baolin.wang@linaro.org>
AuthorDate: Wed, 17 Jan 2018 14:01:28 +0800
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Wed, 28 Feb 2018 14:04:52 +0100

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

---
 kernel/time/clocksource.c | 4 ++++
 1 file changed, 4 insertions(+)

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;

      parent reply	other threads:[~2018-02-28 13:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-17  6:01 [PATCH 1/3] clocksource: Skip to check the override clocksource if override name is empty Baolin Wang
2018-01-17  6:01 ` [PATCH 2/3] clocksource: Use DEVICE_ATTR_RW/RO/WO to define device attributes Baolin Wang
2018-02-28 13:10   ` [tip:timers/core] " tip-bot for Baolin Wang
2018-01-17  6:01 ` [PATCH 3/3] clocksource: Use ATTRIBUTE_GROUPS macro Baolin Wang
2018-02-28 13:10   ` [tip:timers/core] clocksource: Use ATTRIBUTE_GROUPS tip-bot for Baolin Wang
2018-02-28 13:09 ` tip-bot for Baolin Wang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-7f852afe448c95691ead6b57bae5f37562d060b5@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=baolin.wang@linaro.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®