staging: iio: light: constify attribute_group structures
Subsystems (3)
PATCH 1/1 staging: iio: light: constify attribute_group structures
As the event_attrs field of iio_info structures is constant, so these attribute_group structures can also be declared constant.
File size before:
text data bss dec hex filename
15064 1528 0 16592 40d0drivers/staging/iio/light/tsl2x7x_core.o
File size after:
text data bss dec hex filename
15192 1400 0 16592 40d0drivers/staging/iio/light/tsl2x7x_core.o
--- drivers/staging/iio/light/tsl2x7x_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/iio/light/tsl2x7x_core.c +1 -1
@@ -1676,7 +1676,7 @@ static const struct attribute_group tsl2X7X_device_attr_group_tbl[] = { }, }; -static struct attribute_group tsl2X7X_event_attr_group_tbl[] = { +static const struct attribute_group tsl2X7X_event_attr_group_tbl[] = { [ALS ] = { .attrs = tsl2X7X_ALS_event_attrs, .name ="events" ,
Signature · 1 line
2.7.4
Jonathan Cameron
maintainerQuoted 8 lines · simran singhal
As the
event_attrsfield ofiio_infostructures is constant, so theseattribute_groupstructures can also be declared constant.File size before:
text data bss dec hex filename
15064 1528 0 16592 40d0drivers/staging/iio/light/tsl2x7x_core.o
Quoted 6 lines
File size after:
text data bss dec hex filename
15192 1400 0 16592 40d0drivers/staging/iio/light/tsl2x7x_core.oSigned-off-by simran singhal <[email protected]>
Not a big thing, but as this only touches the one driver, i would have liked that mentioned in the naming of the patch...
I've added it.
Applied.
Quoted 18 lines
--- drivers/staging/iio/light/tsl2x7x_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/iio/light/tsl2x7x_core.c +1
-1@@ -1676,7 +1676,7 @@ static const struct attribute_group tsl2X7X_device_attr_group_tbl[] = { }, }; -static struct attribute_group tsl2X7X_event_attr_group_tbl[] = { +static const struct attribute_group tsl2X7X_event_attr_group_tbl[] = { [ALS ] = { .attrs = tsl2X7X_ALS_event_attrs, .name ="events" ,