summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-01-12 01:12:40 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-01-12 01:12:40 +0100
commita889f766dbb7d016b858e4dd157b06587fdb570f (patch)
treee86bb71c643a0a2bd828b26ebbbaab8d780b6073 /drivers
parentMerge branches 'pm-sleep' and 'pm-tools' (diff)
parentpowercap: constify powercap_zone_ops and powercap_zone_constraint_ops structures (diff)
downloadlinux-a889f766dbb7d016b858e4dd157b06587fdb570f.tar.xz
linux-a889f766dbb7d016b858e4dd157b06587fdb570f.zip
Merge branch 'powercap'
* powercap: powercap: constify powercap_zone_ops and powercap_zone_constraint_ops structures
Diffstat (limited to 'drivers')
-rw-r--r--drivers/powercap/intel_rapl.c4
-rw-r--r--drivers/powercap/powercap_sys.c18
2 files changed, 11 insertions, 11 deletions
diff --git a/drivers/powercap/intel_rapl.c b/drivers/powercap/intel_rapl.c
index 4099159ffa3d..6c592dc71aee 100644
--- a/drivers/powercap/intel_rapl.c
+++ b/drivers/powercap/intel_rapl.c
@@ -388,7 +388,7 @@ static int get_domain_enable(struct powercap_zone *power_zone, bool *mode)
}
/* per RAPL domain ops, in the order of rapl_domain_type */
-static struct powercap_zone_ops zone_ops[] = {
+static const struct powercap_zone_ops zone_ops[] = {
/* RAPL_DOMAIN_PACKAGE */
{
.get_energy_uj = get_energy_counter,
@@ -584,7 +584,7 @@ static int get_max_power(struct powercap_zone *power_zone, int id,
return ret;
}
-static struct powercap_zone_constraint_ops constraint_ops = {
+static const struct powercap_zone_constraint_ops constraint_ops = {
.set_power_limit_uw = set_power_limit,
.get_power_limit_uw = get_current_power_limit,
.set_time_window_us = set_time_window,
diff --git a/drivers/powercap/powercap_sys.c b/drivers/powercap/powercap_sys.c
index 84419af16f77..14bde0db8c24 100644
--- a/drivers/powercap/powercap_sys.c
+++ b/drivers/powercap/powercap_sys.c
@@ -293,8 +293,8 @@ err_alloc:
}
static int create_constraints(struct powercap_zone *power_zone,
- int nr_constraints,
- struct powercap_zone_constraint_ops *const_ops)
+ int nr_constraints,
+ const struct powercap_zone_constraint_ops *const_ops)
{
int i;
int ret = 0;
@@ -492,13 +492,13 @@ static struct class powercap_class = {
};
struct powercap_zone *powercap_register_zone(
- struct powercap_zone *power_zone,
- struct powercap_control_type *control_type,
- const char *name,
- struct powercap_zone *parent,
- const struct powercap_zone_ops *ops,
- int nr_constraints,
- struct powercap_zone_constraint_ops *const_ops)
+ struct powercap_zone *power_zone,
+ struct powercap_control_type *control_type,
+ const char *name,
+ struct powercap_zone *parent,
+ const struct powercap_zone_ops *ops,
+ int nr_constraints,
+ const struct powercap_zone_constraint_ops *const_ops)
{
int result;
int nr_attrs;