]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
PM / OPP: pass cpumask by reference
authorArnd Bergmann <arnd@arndb.de>
Sat, 30 Apr 2016 11:33:29 +0000 (13:33 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 4 May 2016 23:34:20 +0000 (01:34 +0200)
commitddbb74bc70c0dbaab85d1aa2564b0b3217267454
treeed673bc1c3fca67c7f84d0199952143edcb7b195
parent6f707daa3833761110a03478cba5cc4b708ec77d
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>
drivers/base/power/opp/cpu.c
include/linux/pm_opp.h