From patchwork Fri Jun 30 16:09:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 106747 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp2522787qge; Fri, 30 Jun 2017 09:09:42 -0700 (PDT) X-Received: by 10.99.134.72 with SMTP id x69mr21506963pgd.210.1498838982629; Fri, 30 Jun 2017 09:09:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498838982; cv=none; d=google.com; s=arc-20160816; b=t30nmZtNW1+wAmBx7B2PNjw52erwWNPfkapjq4dCFsrSu6cpAoewH/xPh3GMwaIkPF R6rbMltBV0k8MFQsO1+UTsJEUmS8kJ1KbiRFJT/3VRG9FgGA6Sf/9EppKYSZkiLEdoVK l8ODnyVkPhaIbHxyMW6FPiGwfNKKcGWu6O1ueau5+uLxa3IV9QQnvkce7xu1ey2t3r4k yzqC+pnFT2YZchqWIqJ7P4wOKtf+3sz96yTlI/Nhw7fgYr5a9DBHiE+GuFhiaIppZ1t4 qFPmyoAi+BO4hebBHDXzcw2hcILWtlN7ec9jZlzyuhMVA9jjlWtDn4uzL53ucFqXC3XJ 1R0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=Ko9xlr28ZBUAoZSTdiH1PVT7G5uVu/n1enXbxZbJ8Hk=; b=bRhFQgCRbYGgVLAx1qx+OOH+F2wPCJsvqHRFj96J2jI6x4M2QQi1rtLW0tTkQBZqd0 hhSS6Iwp0poA9GR2WRh/2EOdvxxOQhc8WOZ7L7urnQNNBtCjCnc3rDVZLLnEceKe4Kdz lAoJ/PNSt/3XvPYJFPFc9805G20IT9mGCH3UEkcGted5oJaBb5TLmbLqJE5nMUJ8pt18 KXLVLC9ZB5K0mNGhycDhnKcK/+1lNhmBGSMovE6jiW7bn2imyOwLQNBOS5djcXWyDG2k rr7AxbA6bfGZluf7t4D6x+8T5lHBglkrdTAGOKRlkV+ZtBqeL0mMub+x/fGmHCNTVnt6 NRdg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-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 o17si5978730pgj.552.2017.06.30.09.09.42; Fri, 30 Jun 2017 09:09:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-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-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751945AbdF3QJl (ORCPT + 14 others); Fri, 30 Jun 2017 12:09:41 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:59537 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751560AbdF3QJk (ORCPT ); Fri, 30 Jun 2017 12:09:40 -0400 Received: from wuerfel.lan ([5.56.224.194]) by mrelayeu.kundenserver.de (mreue103 [212.227.15.145]) with ESMTPA (Nemesis) id 0MgI6w-1d3EYu35cc-00NfF8; Fri, 30 Jun 2017 18:09:22 +0200 From: Arnd Bergmann To: "Rafael J. Wysocki" Cc: Arnd Bergmann , Kevin Hilman , Ulf Hansson , Pavel Machek , Len Brown , Greg Kroah-Hartman , Jon Hunter , Lina Iyer , Krzysztof Kozlowski , Mikko Perttunen , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] PM / Domains: avoid unused function warning Date: Fri, 30 Jun 2017 18:09:13 +0200 Message-Id: <20170630160921.4192052-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:s1ojfZbRzyBWWcMgVHDNuzP5ZgjsmxHd9GEINyfIDkeZGOGqWIk muGzODmofG+s28Z1qeuPLZJlZcdeBo5L4je3cWLwBwQygwzxMm8PXxzMl0sEVABHihMpixk 6X4a3a5T2o5K6FPueAlr2v0GFO9PnHJz/sGHLslx4g+3I6mnUaEKO9Bgp2cq7CpTbgI9kTa yOmGygPXlceDpSWO5rwqg== X-UI-Out-Filterresults: notjunk:1; V01:K0:YK62u05Zjaw=:vGY6t0WPLpuZdwQrnOs3fC YxE+/pjcZmZxrUZLk1OR58J/jZFh+3sQRlsU0ZSnMKBCjmqDwG5CB+ZDfzJ7y7zy4bjAnt7Yx AB02xHMJOhYeBRDYyIMk12K1aE64rrKoMHV9pPpHalhCXM4n936jWgXDWxOkxVI5ir5JEKx68 aV6zLKwG2PLCkGkpJWemx0xXrzQLd0/rCZAd85RKShOSvaOC24yXTI/7VaaSeYrXLwHC+W8/7 uwEOjX03w81W7iB4Bhq4KLp3BJslv+kOg3SckT55yPHp0kH+PCuY4BioVfgG3GHiL2SlcUuaR 33awYc/TBUJM4Y26IKwuMYZdfRtG5TqsngOFkZlxRDSPY54dG6TkdjemapXFfflaaulDL7pLS IPkIckrErB4O00RxqWgLq4gwCUoxUIeJy5JT4qVlpA8JqoaDcXo2P/D44YAAwbk0fMWklZMyu JxfbLzwzINcyhN87IqU50Ofghsh0dlXt+Yf8FqtXQpHH9kV3jzD5c9sULHu38mi11TzZcJibn ALe8nffJSwIk/CnZ6gWYAGab1HzJHZDXyyzmGqHr5wVGkJX4V/Z7qKDBQhSJFdpeGGNRyQKP7 meRxTIrMEGc2cGiZpf20QUwmeLyU8IOI5DHUPmHVXyDhLbb568Ko8xWdLif54jNp64hrHYDZN ZNHaiGrccNiJagzXxMLd+DQlS+upMXNWSJJjbBh76vrjaS2ukH7pn9BjQEBMkdv1OBis= Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The only caller of pm_genpd_present outside of CONFIG_PM_GENERIC_DOMAINS_OF was removed, so we now get a warning when that is disabled: drivers/base/power/domain.c:725:13: error: 'pm_genpd_present' defined but not used [-Werror=unused-function] This moves the function definition inside of the #ifdef section. Fixes: 8b55e55ee443 ("PM / Domains: Handle safely genpd_syscore_switch() call on non-genpd device") Signed-off-by: Arnd Bergmann --- drivers/base/power/domain.c | 40 ++++++++++++++++++---------------------- 1 file changed, 18 insertions(+), 22 deletions(-) -- 2.9.0 diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index 7eca0f0cbc3b..a380d9d61335 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -716,28 +716,6 @@ static int __init genpd_power_off_unused(void) } late_initcall(genpd_power_off_unused); -#if defined(CONFIG_PM_SLEEP) || defined(CONFIG_PM_GENERIC_DOMAINS_OF) - -/** - * pm_genpd_present - Check if the given PM domain has been initialized. - * @genpd: PM domain to check. - */ -static bool pm_genpd_present(const struct generic_pm_domain *genpd) -{ - const struct generic_pm_domain *gpd; - - if (IS_ERR_OR_NULL(genpd)) - return false; - - list_for_each_entry(gpd, &gpd_list, gpd_list_node) - if (gpd == genpd) - return true; - - return false; -} - -#endif - #ifdef CONFIG_PM_SLEEP static bool genpd_dev_active_wakeup(const struct generic_pm_domain *genpd, @@ -1675,6 +1653,24 @@ static LIST_HEAD(of_genpd_providers); static DEFINE_MUTEX(of_genpd_mutex); /** + * pm_genpd_present - Check if the given PM domain has been initialized. + * @genpd: PM domain to check. + */ +static bool pm_genpd_present(const struct generic_pm_domain *genpd) +{ + const struct generic_pm_domain *gpd; + + if (IS_ERR_OR_NULL(genpd)) + return false; + + list_for_each_entry(gpd, &gpd_list, gpd_list_node) + if (gpd == genpd) + return true; + + return false; +} + +/** * genpd_xlate_simple() - Xlate function for direct node-domain mapping * @genpdspec: OF phandle args to map into a PM domain * @data: xlate function private data - pointer to struct generic_pm_domain