]> git.sur5r.net Git - groeck-nct6775/commitdiff
hwmon: (nct6775) constify sensor_template_group structures
authorJulia Lawall <Julia.Lawall@lip6.fr>
Sat, 12 Dec 2015 16:36:39 +0000 (17:36 +0100)
committerGuenter Roeck <linux@roeck-us.net>
Thu, 4 Aug 2016 13:32:19 +0000 (06:32 -0700)
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>
nct6775.c

index 068fb9bb950bd49dd8b7385411bda2b9ca1c9eb3..3cd9a38442d55757594f0b290b04c8560fa578d5 100644 (file)
--- a/nct6775.c
+++ b/nct6775.c
@@ -1050,7 +1050,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;
@@ -1832,7 +1833,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,
 };
@@ -2051,7 +2052,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,
@@ -2260,7 +2261,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,
@@ -3134,7 +3135,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,