From patchwork Sat Apr 30 11:33:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102402 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp181601qge; Sat, 30 Apr 2016 04:34:38 -0700 (PDT) X-Received: by 10.67.14.7 with SMTP id fc7mr36236129pad.1.1462016077959; Sat, 30 Apr 2016 04:34:37 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 25si22263180pfh.120.2016.04.30.04.34.37; Sat, 30 Apr 2016 04:34:37 -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 S1751691AbcD3Leg (ORCPT + 13 others); Sat, 30 Apr 2016 07:34:36 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:56745 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751548AbcD3Lef (ORCPT ); Sat, 30 Apr 2016 07:34:35 -0400 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue001) with ESMTPA (Nemesis) id 0MFUge-1aqzVC2iVI-00EKic; Sat, 30 Apr 2016 13:34:14 +0200 From: Arnd Bergmann To: Viresh Kumar , "Rafael J. Wysocki" Cc: Arnd Bergmann , Nishanth Menon , Stephen Boyd , Len Brown , Pavel Machek , Greg Kroah-Hartman , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] PM / OPP: pass cpumask by reference Date: Sat, 30 Apr 2016 13:33:29 +0200 Message-Id: <1462016049-1976580-1-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 X-Provags-ID: V03:K0:AcqjZRUUAmRRP4b02OMR8TFyVnhPI4kDVxQNp0hx54YAdxFhuxn jgsAasS9Grg0QdgBf7KAbhLib0gd90JybBBFQbgNzar1+sLnzlKjJTRfSwBV651kiYSMqeX tDM/NitGUFj7nkrgvso71NxcOamWKY7rU7jYbZer4YEDeB+Ms03OygMvDviQlUnEOREgWdz Qv2sVH/gKTE6rSHUNfnuw== X-UI-Out-Filterresults: notjunk:1; V01:K0:brbYKOi3MH4=:Eb8K/DcdIp82T0VnUt4G/x A4y5YDQQ/S6L6PUm8UxCGAC8Ia1KMmmSrFGCGk56NyUhA72Pgq/PUIt1d4sIumbvoiNahyZuS uJGbbT68//gUbPe/2H0pnj2bUE4eTS+awzRJJ7F/DXXsawQnsAI4cP+wlEbg9d9wtcC2jR5KV d0gl/K7iosPiiyvkGnJTDeYV7BYgSQZXyphKGDj7Is+Um7k9Q2reNLO9z52LurVJjG9EIWFGB ZRoNNGYQK/QXcwwBX4M+XPtnQiJzSokSs936hzrmZ7Ap1guXA2NCjkfh4KGb6+aOtpgzUJSpC SUP2pupAD3/+A1pVfUfpLjxYY47cYTuv0pDL7HMSalf6Rj4jzi8EOXd85T/fQFXPpsJysODx3 d4QbO62MXfYUtJtw5+H6oiq+rKy+ib8wdjJGtbKOSRmbwmxXkr2CsnPz/qjSXlN4Lz5iyXGyr 4ktZz9+hS4bNQuGU7ywnbelv32v5Az2880FNGSYk/GX1MvAimhYdTjcs7H3dxd7ZZgqMNGLDF 2wiK+T2RAfeBE2KA9UH3zlI8ZBHE4HYSUYj5ixnNEd9BWijV3ENirmV3fQBWzr5p65THgWzy6 VNOGzg7iauZr1h3IG7zZW6tqLTjrJ29eJUBfg0Ok90ZCFwYx82+RECxinAzV4rlnPZrFfY9UW de8gyOZraICzfXug1d7b/p5bPHGgkVI0T3aCwiH4odZokt242x3GA15RAVwwLrjz1RYI= Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The new use of dev_pm_opp_set_sharing_cpus resulted in a harmless compiler warning with CONFIG_CPUMASK_OFFSTACK=y: drivers/cpufreq/mvebu-cpufreq.c: In function 'armada_xp_pmsu_cpufreq_init': include/linux/cpumask.h:550:25: error: passing argument 2 of 'dev_pm_opp_set_sharing_cpus' discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers] The problem here is that cpumask_var_t gets passed by reference, but by declaring a 'const cpumask_var_t' argument, only the pointer is constant, not the actual mask. This is harmless because the function does not actually modify the mask. This patch changes the function prototypes for all of the related functions to pass a 'struct cpumask *' instead of 'cpumask_var_t', matching what most other such functions do in the kernel. This lets us mark all the other similar functions as taking a 'const' mask where possible, and it avoids the warning without any change in object code. Signed-off-by: Arnd Bergmann Fixes: 947bd567f7a5 ("mvebu: Use dev_pm_opp_set_sharing_cpus() to mark OPP tables as shared") --- drivers/base/power/opp/cpu.c | 10 +++++----- include/linux/pm_opp.h | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) -- 2.7.0 -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/base/power/opp/cpu.c b/drivers/base/power/opp/cpu.c index 3428380dfca7..8e0b6349d7d4 100644 --- a/drivers/base/power/opp/cpu.c +++ b/drivers/base/power/opp/cpu.c @@ -132,7 +132,7 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_free_cpufreq_table); * that this function is *NOT* called under RCU protection or in contexts where * mutex cannot be locked. */ -void dev_pm_opp_of_cpumask_remove_table(cpumask_var_t cpumask) +void dev_pm_opp_of_cpumask_remove_table(const struct cpumask *cpumask) { struct device *cpu_dev; int cpu; @@ -164,7 +164,7 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_of_cpumask_remove_table); * that this function is *NOT* called under RCU protection or in contexts where * mutex cannot be locked. */ -int dev_pm_opp_of_cpumask_add_table(cpumask_var_t cpumask) +int dev_pm_opp_of_cpumask_add_table(const struct cpumask *cpumask) { struct device *cpu_dev; int cpu, ret = 0; @@ -217,7 +217,7 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_of_cpumask_add_table); * that this function is *NOT* called under RCU protection or in contexts where * mutex cannot be locked. */ -int dev_pm_opp_of_get_sharing_cpus(struct device *cpu_dev, cpumask_var_t cpumask) +int dev_pm_opp_of_get_sharing_cpus(struct device *cpu_dev, struct cpumask *cpumask) { struct device_node *np, *tmp_np; struct device *tcpu_dev; @@ -288,7 +288,7 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_of_get_sharing_cpus); * mutex cannot be locked. */ int dev_pm_opp_set_sharing_cpus(struct device *cpu_dev, - const cpumask_var_t cpumask) + const struct cpumask *cpumask) { struct opp_device *opp_dev; struct opp_table *opp_table; @@ -346,7 +346,7 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_set_sharing_cpus); * that this function is *NOT* called under RCU protection or in contexts where * mutex cannot be locked. */ -int dev_pm_opp_get_sharing_cpus(struct device *cpu_dev, cpumask_var_t cpumask) +int dev_pm_opp_get_sharing_cpus(struct device *cpu_dev, struct cpumask *cpumask) { struct opp_device *opp_dev; struct opp_table *opp_table; diff --git a/include/linux/pm_opp.h b/include/linux/pm_opp.h index 15f554443b59..5221d259e413 100644 --- a/include/linux/pm_opp.h +++ b/include/linux/pm_opp.h @@ -65,8 +65,8 @@ void dev_pm_opp_put_prop_name(struct device *dev); int dev_pm_opp_set_regulator(struct device *dev, const char *name); void dev_pm_opp_put_regulator(struct device *dev); int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq); -int dev_pm_opp_set_sharing_cpus(struct device *cpu_dev, const cpumask_var_t cpumask); -int dev_pm_opp_get_sharing_cpus(struct device *cpu_dev, cpumask_var_t cpumask); +int dev_pm_opp_set_sharing_cpus(struct device *cpu_dev, const struct cpumask *cpumask); +int dev_pm_opp_get_sharing_cpus(struct device *cpu_dev, struct cpumask *cpumask); #else static inline unsigned long dev_pm_opp_get_voltage(struct dev_pm_opp *opp) { @@ -180,12 +180,12 @@ static inline int dev_pm_opp_set_rate(struct device *dev, unsigned long target_f return -ENOTSUPP; } -static inline int dev_pm_opp_set_sharing_cpus(struct device *cpu_dev, const cpumask_var_t cpumask) +static inline int dev_pm_opp_set_sharing_cpus(struct device *cpu_dev, const struct cpumask *cpumask) { return -ENOTSUPP; } -static inline int dev_pm_opp_get_sharing_cpus(struct device *cpu_dev, cpumask_var_t cpumask) +static inline int dev_pm_opp_get_sharing_cpus(struct device *cpu_dev, struct cpumask *cpumask) { return -EINVAL; } @@ -195,9 +195,9 @@ static inline int dev_pm_opp_get_sharing_cpus(struct device *cpu_dev, cpumask_va #if defined(CONFIG_PM_OPP) && defined(CONFIG_OF) int dev_pm_opp_of_add_table(struct device *dev); void dev_pm_opp_of_remove_table(struct device *dev); -int dev_pm_opp_of_cpumask_add_table(cpumask_var_t cpumask); -void dev_pm_opp_of_cpumask_remove_table(cpumask_var_t cpumask); -int dev_pm_opp_of_get_sharing_cpus(struct device *cpu_dev, cpumask_var_t cpumask); +int dev_pm_opp_of_cpumask_add_table(const struct cpumask *cpumask); +void dev_pm_opp_of_cpumask_remove_table(const struct cpumask *cpumask); +int dev_pm_opp_of_get_sharing_cpus(struct device *cpu_dev, struct cpumask *cpumask); #else static inline int dev_pm_opp_of_add_table(struct device *dev) { @@ -208,16 +208,16 @@ static inline void dev_pm_opp_of_remove_table(struct device *dev) { } -static inline int dev_pm_opp_of_cpumask_add_table(cpumask_var_t cpumask) +static inline int dev_pm_opp_of_cpumask_add_table(const struct cpumask *cpumask) { return -ENOTSUPP; } -static inline void dev_pm_opp_of_cpumask_remove_table(cpumask_var_t cpumask) +static inline void dev_pm_opp_of_cpumask_remove_table(const struct cpumask *cpumask) { } -static inline int dev_pm_opp_of_get_sharing_cpus(struct device *cpu_dev, cpumask_var_t cpumask) +static inline int dev_pm_opp_of_get_sharing_cpus(struct device *cpu_dev, struct cpumask *cpumask) { return -ENOTSUPP; }