Skip to content

Commit

Permalink
hwmon: (nct6683,nct6775) constify sensor_template_group structures
Browse files Browse the repository at this point in the history
The sensor_template_group structures are never modified, so declare them as
const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
  • Loading branch information
Julia Lawall authored and Guenter Roeck committed Dec 18, 2015
1 parent 96818b5 commit c60fdf8
Showing 2 changed files with 12 additions and 10 deletions.
11 changes: 6 additions & 5 deletions drivers/hwmon/nct6683.c
Original file line number Diff line number Diff line change
@@ -394,7 +394,8 @@ struct sensor_template_group {
};

static struct attribute_group *
nct6683_create_attr_group(struct device *dev, struct sensor_template_group *tg,
nct6683_create_attr_group(struct device *dev,
const struct sensor_template_group *tg,
int repeat)
{
struct sensor_device_attribute_2 *a2;
@@ -703,7 +704,7 @@ static struct sensor_device_template *nct6683_attributes_in_template[] = {
NULL
};

static struct sensor_template_group nct6683_in_template_group = {
static const struct sensor_template_group nct6683_in_template_group = {
.templates = nct6683_attributes_in_template,
.is_visible = nct6683_in_is_visible,
};
@@ -774,7 +775,7 @@ static struct sensor_device_template *nct6683_attributes_fan_template[] = {
NULL
};

static struct sensor_template_group nct6683_fan_template_group = {
static const struct sensor_template_group nct6683_fan_template_group = {
.templates = nct6683_attributes_fan_template,
.is_visible = nct6683_fan_is_visible,
.base = 1,
@@ -902,7 +903,7 @@ static struct sensor_device_template *nct6683_attributes_temp_template[] = {
NULL
};

static struct sensor_template_group nct6683_temp_template_group = {
static const struct sensor_template_group nct6683_temp_template_group = {
.templates = nct6683_attributes_temp_template,
.is_visible = nct6683_temp_is_visible,
.base = 1,
@@ -938,7 +939,7 @@ static struct sensor_device_template *nct6683_attributes_pwm_template[] = {
NULL
};

static struct sensor_template_group nct6683_pwm_template_group = {
static const struct sensor_template_group nct6683_pwm_template_group = {
.templates = nct6683_attributes_pwm_template,
.is_visible = nct6683_pwm_is_visible,
.base = 1,
11 changes: 6 additions & 5 deletions drivers/hwmon/nct6775.c
Original file line number Diff line number Diff line change
@@ -1045,7 +1045,8 @@ struct sensor_template_group {
};

static struct attribute_group *
nct6775_create_attr_group(struct device *dev, struct sensor_template_group *tg,
nct6775_create_attr_group(struct device *dev,
const struct sensor_template_group *tg,
int repeat)
{
struct attribute_group *group;
@@ -1827,7 +1828,7 @@ static struct sensor_device_template *nct6775_attributes_in_template[] = {
NULL
};

static struct sensor_template_group nct6775_in_template_group = {
static const struct sensor_template_group nct6775_in_template_group = {
.templates = nct6775_attributes_in_template,
.is_visible = nct6775_in_is_visible,
};
@@ -2046,7 +2047,7 @@ static struct sensor_device_template *nct6775_attributes_fan_template[] = {
NULL
};

static struct sensor_template_group nct6775_fan_template_group = {
static const struct sensor_template_group nct6775_fan_template_group = {
.templates = nct6775_attributes_fan_template,
.is_visible = nct6775_fan_is_visible,
.base = 1,
@@ -2255,7 +2256,7 @@ static struct sensor_device_template *nct6775_attributes_temp_template[] = {
NULL
};

static struct sensor_template_group nct6775_temp_template_group = {
static const struct sensor_template_group nct6775_temp_template_group = {
.templates = nct6775_attributes_temp_template,
.is_visible = nct6775_temp_is_visible,
.base = 1,
@@ -3117,7 +3118,7 @@ static struct sensor_device_template *nct6775_attributes_pwm_template[] = {
NULL
};

static struct sensor_template_group nct6775_pwm_template_group = {
static const struct sensor_template_group nct6775_pwm_template_group = {
.templates = nct6775_attributes_pwm_template,
.is_visible = nct6775_pwm_is_visible,
.base = 1,

0 comments on commit c60fdf8

Please sign in to comment.