@@ -341,7 +341,7 @@ static int get_max_power_uw(struct powercap_zone *pcz, int id, u64 *max_power)
return 0;
}
-static struct powercap_zone_constraint_ops constraint_ops = {
+static const struct powercap_zone_constraint_ops constraint_ops = {
.set_power_limit_uw = set_power_limit_uw,
.get_power_limit_uw = get_power_limit_uw,
.set_time_window_us = set_time_window_us,
@@ -350,7 +350,7 @@ static struct powercap_zone_constraint_ops constraint_ops = {
.get_name = get_constraint_name,
};
-static struct powercap_zone_ops zone_ops = {
+static const struct powercap_zone_ops zone_ops = {
.get_max_power_range_uw = get_max_power_range_uw,
.get_power_uw = get_power_uw,
.release = dtpm_release_zone,
These are only passed as input to powercap_register_zone() which takes pointers to const powercap_zone_ops and powercap_zone_constraint_ops. Make them const to allow the compiler to put them in read-only memory. Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> --- drivers/powercap/dtpm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)