constify misc attribute_group structures.
Subsystems (2)
cover constify misc attribute_group structures.
attribute_group are not supposed to change at runtime. All functions working with attribute_group provided by <linux/sysfs.h> work with const attribute_group. So mark the non-const structs as const.
Arvind Yadav (6):
[PATCH 1/6] misc: apds9802als: constify attribute_group structures. [PATCH 2/6] misc: apds990x: constify attribute_group structures. [PATCH 3/6] misc: bh1770glc: constify attribute_group structures. [PATCH 4/6] misc: isl29020: constify attribute_group structures. [PATCH 5/6] misc: lis3lv02d: constify attribute_group structures. [PATCH 6/6] misc: ti-st: constify attribute_group structures.
drivers/misc/apds9802als.c | 2 +- drivers/misc/apds990x.c | 2 +- drivers/misc/bh1770glc.c | 2 +- drivers/misc/isl29020.c | 2 +- drivers/misc/lis3lv02d/lis3lv02d.c | 2 +- drivers/misc/ti-st/st_kim.c | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-)
Signature · 1 line
1.9.1
PATCH 3/6 misc: bh1770glc: constify attribute_group structures.
attribute_group are not supposed to change at runtime. All functions working with attribute_group provided by <linux/sysfs.h> work with const attribute_group. So mark the non-const structs as const.
--- drivers/misc/bh1770glc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/bh1770glc.c +1 -1
@@ -1175,7 +1175,7 @@ static DEVICE_ATTR(power_state, S_IRUGO | S_IWUSR, bh1770_power_state_show, NULL }; -static struct attribute_group bh1770_attribute_group = { +static const struct attribute_group bh1770_attribute_group = { .attrs = sysfs_attrs };
Signature · 1 line
1.9.1
PATCH 4/6 misc: isl29020: constify attribute_group structures.
In reply to Arvind Yadavattribute_group are not supposed to change at runtime. All functions working with attribute_group provided by <linux/sysfs.h> work with const attribute_group. So mark the non-const structs as const.
--- drivers/misc/isl29020.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/isl29020.c +1 -1
@@ -145,7 +145,7 @@ static DEVICE_ATTR(lux0_sensor_range, S_IRUGO | S_IWUSR, NULL }; -static struct attribute_group m_als_gr = { +static const struct attribute_group m_als_gr = { .name ="isl29020" , .attrs = mid_att_als };
Signature · 1 line
1.9.1
PATCH 2/6 misc: apds990x: constify attribute_group structures.
In reply to Arvind Yadavattribute_group are not supposed to change at runtime. All functions working with attribute_group provided by <linux/sysfs.h> work with const attribute_group. So mark the non-const structs as const.
--- drivers/misc/apds990x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/apds990x.c +1 -1
@@ -1051,7 +1051,7 @@ static ssize_t apds990x_chip_id_show(struct device *dev, NULL }; -static struct attribute_group apds990x_attribute_group[] = { +static const struct attribute_group apds990x_attribute_group[] = { {.attrs = sysfs_attrs_ctrl }, };
Signature · 1 line
1.9.1
PATCH 6/6 misc: ti-st: constify attribute_group structures.
In reply to Arvind Yadavattribute_group are not supposed to change at runtime. All functions working with attribute_group provided by <linux/sysfs.h> work with const attribute_group. So mark the non-const structs as const.
--- drivers/misc/ti-st/st_kim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/ti-st/st_kim.c +1 -1
@@ -660,7 +660,7 @@ static ssize_t show_flow_cntrl(struct device *dev, NULL, }; -static struct attribute_group uim_attr_grp = { +static const struct attribute_group uim_attr_grp = { .attrs = uim_attrs, };
Signature · 1 line
1.9.1
PATCH 5/6 misc: lis3lv02d: constify attribute_group structures.
In reply to Arvind Yadavattribute_group are not supposed to change at runtime. All functions working with attribute_group provided by <linux/sysfs.h> work with const attribute_group. So mark the non-const structs as const.
--- drivers/misc/lis3lv02d/lis3lv02d.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/lis3lv02d/lis3lv02d.c +1 -1
@@ -856,7 +856,7 @@ static DEVICE_ATTR(rate, S_IRUGO | S_IWUSR, lis3lv02d_rate_show, NULL }; -static struct attribute_group lis3lv02d_attribute_group = { +static const struct attribute_group lis3lv02d_attribute_group = { .attrs = lis3lv02d_attributes };
Signature · 1 line
1.9.1
PATCH 1/6 misc: apds9802als: constify attribute_group structures.
In reply to Arvind Yadavattribute_group are not supposed to change at runtime. All functions working with attribute_group provided by <linux/sysfs.h> work with const attribute_group. So mark the non-const structs as const.
--- drivers/misc/apds9802als.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/apds9802als.c +1 -1
@@ -197,7 +197,7 @@ static DEVICE_ATTR(lux0_sensor_range, S_IRUGO | S_IWUSR, NULL }; -static struct attribute_group m_als_gr = { +static const struct attribute_group m_als_gr = { .name ="apds9802als" , .attrs = mid_att_als };
Signature · 1 line
1.9.1
Arnd Bergmann
maintainerQuoted 11 lines · Arvind Yadav
attribute_groupare not supposed to change at runtime. All functions working withattribute_groupprovided by <linux/sysfs.h> work with constattribute_group. So mark the non-const structs as const.Arvind Yadav (6):
[PATCH 1/6] misc: apds9802als: constifyattribute_groupstructures. [PATCH 2/6] misc: apds990x: constifyattribute_groupstructures. [PATCH 3/6] misc: bh1770glc: constifyattribute_groupstructures. [PATCH 4/6] misc: isl29020: constifyattribute_groupstructures. [PATCH 5/6] misc: lis3lv02d: constifyattribute_groupstructures. [PATCH 6/6] misc: ti-st: constifyattribute_groupstructures.
Looks good to me, thanks
Arnd