Skip to content

Commit

Permalink
Merge branch 'powercap'
Browse files Browse the repository at this point in the history
* powercap:
  powercap: constify powercap_zone_ops and powercap_zone_constraint_ops structures
  • Loading branch information
rafaeljw committed Jan 12, 2016
2 parents 8f053a5 + 600c395 commit a889f76
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions drivers/powercap/intel_rapl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
18 changes: 9 additions & 9 deletions drivers/powercap/powercap_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,8 @@ static int seed_constraint_attributes(void)
}

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;
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions include/linux/powercap.h
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ struct powercap_zone_constraint_ops {
struct powercap_zone_constraint {
int id;
struct powercap_zone *power_zone;
struct powercap_zone_constraint_ops *ops;
const struct powercap_zone_constraint_ops *ops;
};


Expand Down Expand Up @@ -309,7 +309,7 @@ struct powercap_zone *powercap_register_zone(
struct powercap_zone *parent,
const struct powercap_zone_ops *ops,
int nr_constraints,
struct powercap_zone_constraint_ops *const_ops);
const struct powercap_zone_constraint_ops *const_ops);

/**
* powercap_unregister_zone() - Unregister a zone device
Expand Down

0 comments on commit a889f76

Please sign in to comment.