Received: by 10.223.185.116 with SMTP id b49csp6259369wrg; Wed, 28 Feb 2018 06:35:48 -0800 (PST) X-Google-Smtp-Source: AH8x226eNNgEoqHD/0C5YmLSYGczNm80OvGJTuokk018ZIeCsw2W/5xXzYqeFKq68YzAW5pFaPK9 X-Received: by 2002:a17:902:6f17:: with SMTP id w23-v6mr18280434plk.336.1519828547911; Wed, 28 Feb 2018 06:35:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519828547; cv=none; d=google.com; s=arc-20160816; b=hfXQLAejZVT7EXQt1dUbv0tMuN8lBC1JLapr0uegNX0HQRuWjViwJuNdn4pcpTQwQZ +IGbz8wPpLzORpfwteH8aWHIfxT75yQXNUSCrQIvk5fCYgP6US9Fnys4t+FaAxskIynH kyH1Q+B3VaNRYSlI+hGVo83P6aDp1eh4ubcjNVchdNyJq1kB1mcV2c3Jfs45t2KHqJBy tKkPqJqw6LPvq1J8YFbZ0ynwfwLZmGwcdplTVrTvExQMd1dpuznzHo+7uCWj/X0aJZAh gdC1jESrx2UYzJt/jDDBcG4OwGcBPTICwD4gHSxsM0l75A6SDi75RguEPS/zorIR31n9 ss0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=HQ37JnQkyghe/BMMuWps6Teva95z4pzISVibDNOTizY=; b=Ilzp0+8dhZz2bIfsm9tnF6mohPz7NQsGNRJ2cidJU1uwJDCnJ25NbGnXqahAoSM9DK lRWJN5KVEjQzQPTomF6TR4nwm2w+v0xbD5cQa0oZeddXbwDEAsh5VD9JWRec1RD3Ognu VgE1alIOloIKbZ4Yacj2JgxGbPzB7AGN0TmnyU//qInFUIVso3s6Tc0b+wk58AMkrS73 CUxJYboqFO4ADda0+a9QmnkS+0kwKvr8oRJaIXlZUii+Q35wDl1CCSJhurDVmcx97Ooc /pGeRLc0fnN0kIlgHR6zwxmb+MFzk7EEUHGJuGr6dPrMG1ssRwTA/GS9TLvVSTzuwXt4 ajmA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m5-v6si1433234plt.235.2018.02.28.06.35.33; Wed, 28 Feb 2018 06:35:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752598AbeB1NJ6 (ORCPT + 99 others); Wed, 28 Feb 2018 08:09:58 -0500 Received: from terminus.zytor.com ([198.137.202.136]:59355 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752229AbeB1NJ5 (ORCPT ); Wed, 28 Feb 2018 08:09:57 -0500 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTP id w1SD9nLd006080; Wed, 28 Feb 2018 05:09:49 -0800 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w1SD9nKI006077; Wed, 28 Feb 2018 05:09:49 -0800 Date: Wed, 28 Feb 2018 05:09:49 -0800 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Baolin Wang Message-ID: Cc: linux-kernel@vger.kernel.org, mingo@kernel.org, hpa@zytor.com, tglx@linutronix.de, baolin.wang@linaro.org Reply-To: linux-kernel@vger.kernel.org, mingo@kernel.org, tglx@linutronix.de, baolin.wang@linaro.org, hpa@zytor.com In-Reply-To: <069ce2a605546bcad6552968cff755f0a03f9f10.1516167691.git.baolin.wang@linaro.org> References: <069ce2a605546bcad6552968cff755f0a03f9f10.1516167691.git.baolin.wang@linaro.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:timers/core] clocksource: Don't walk the clocksource list for empty override Git-Commit-ID: 7f852afe448c95691ead6b57bae5f37562d060b5 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 7f852afe448c95691ead6b57bae5f37562d060b5 Gitweb: https://git.kernel.org/tip/7f852afe448c95691ead6b57bae5f37562d060b5 Author: Baolin Wang AuthorDate: Wed, 17 Jan 2018 14:01:28 +0800 Committer: Thomas Gleixner 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 Signed-off-by: Thomas Gleixner 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;