summaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2016-04-30 07:33:29 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-05-04 19:34:20 -0400
commitddbb74bc70c0dbaab85d1aa2564b0b3217267454 (patch)
treeed673bc1c3fca67c7f84d0199952143edcb7b195 /drivers/base
parent6f707daa3833761110a03478cba5cc4b708ec77d (diff)
PM / OPP: pass cpumask by reference
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 <arnd@arndb.de> Fixes: 947bd567f7a5 (mvebu: Use dev_pm_opp_set_sharing_cpus() to mark OPP tables as shared) Acked-by: Pavel Machek <pavel@ucw.cz> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/power/opp/cpu.c10
1 files changed, 5 insertions, 5 deletions
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);
132 * that this function is *NOT* called under RCU protection or in contexts where 132 * that this function is *NOT* called under RCU protection or in contexts where
133 * mutex cannot be locked. 133 * mutex cannot be locked.
134 */ 134 */
135void dev_pm_opp_of_cpumask_remove_table(cpumask_var_t cpumask) 135void dev_pm_opp_of_cpumask_remove_table(const struct cpumask *cpumask)
136{ 136{
137 struct device *cpu_dev; 137 struct device *cpu_dev;
138 int cpu; 138 int cpu;
@@ -164,7 +164,7 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_of_cpumask_remove_table);
164 * that this function is *NOT* called under RCU protection or in contexts where 164 * that this function is *NOT* called under RCU protection or in contexts where
165 * mutex cannot be locked. 165 * mutex cannot be locked.
166 */ 166 */
167int dev_pm_opp_of_cpumask_add_table(cpumask_var_t cpumask) 167int dev_pm_opp_of_cpumask_add_table(const struct cpumask *cpumask)
168{ 168{
169 struct device *cpu_dev; 169 struct device *cpu_dev;
170 int cpu, ret = 0; 170 int cpu, ret = 0;
@@ -217,7 +217,7 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_of_cpumask_add_table);
217 * that this function is *NOT* called under RCU protection or in contexts where 217 * that this function is *NOT* called under RCU protection or in contexts where
218 * mutex cannot be locked. 218 * mutex cannot be locked.
219 */ 219 */
220int dev_pm_opp_of_get_sharing_cpus(struct device *cpu_dev, cpumask_var_t cpumask) 220int dev_pm_opp_of_get_sharing_cpus(struct device *cpu_dev, struct cpumask *cpumask)
221{ 221{
222 struct device_node *np, *tmp_np; 222 struct device_node *np, *tmp_np;
223 struct device *tcpu_dev; 223 struct device *tcpu_dev;
@@ -288,7 +288,7 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_of_get_sharing_cpus);
288 * mutex cannot be locked. 288 * mutex cannot be locked.
289 */ 289 */
290int dev_pm_opp_set_sharing_cpus(struct device *cpu_dev, 290int dev_pm_opp_set_sharing_cpus(struct device *cpu_dev,
291 const cpumask_var_t cpumask) 291 const struct cpumask *cpumask)
292{ 292{
293 struct opp_device *opp_dev; 293 struct opp_device *opp_dev;
294 struct opp_table *opp_table; 294 struct opp_table *opp_table;
@@ -346,7 +346,7 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_set_sharing_cpus);
346 * that this function is *NOT* called under RCU protection or in contexts where 346 * that this function is *NOT* called under RCU protection or in contexts where
347 * mutex cannot be locked. 347 * mutex cannot be locked.
348 */ 348 */
349int dev_pm_opp_get_sharing_cpus(struct device *cpu_dev, cpumask_var_t cpumask) 349int dev_pm_opp_get_sharing_cpus(struct device *cpu_dev, struct cpumask *cpumask)
350{ 350{
351 struct opp_device *opp_dev; 351 struct opp_device *opp_dev;
352 struct opp_table *opp_table; 352 struct opp_table *opp_table;