Skip to content

Commit d9a77b9

Browse files
ArvindYadavCsmchehab
authored andcommitted
media: imon: constify attribute_group structures
attribute_groups are not supposed to change at runtime. All functions working with attribute_groups provided by <linux/sysfs.h> work with const attribute_group. So mark the non-const structs as const. File size before: text data bss dec hex filename 18551 2256 77 20884 5194 drivers/media/rc/imon.o File size After adding 'const': text data bss dec hex filename 18679 2160 77 20916 51b4 drivers/media/rc/imon.o Signed-off-by: Arvind Yadav <[email protected]> Signed-off-by: Sean Young <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 6efa094 commit d9a77b9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/media/rc/imon.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,7 @@ static struct attribute *imon_display_sysfs_entries[] = {
911911
NULL
912912
};
913913

914-
static struct attribute_group imon_display_attr_group = {
914+
static const struct attribute_group imon_display_attr_group = {
915915
.attrs = imon_display_sysfs_entries
916916
};
917917

@@ -920,7 +920,7 @@ static struct attribute *imon_rf_sysfs_entries[] = {
920920
NULL
921921
};
922922

923-
static struct attribute_group imon_rf_attr_group = {
923+
static const struct attribute_group imon_rf_attr_group = {
924924
.attrs = imon_rf_sysfs_entries
925925
};
926926

0 commit comments

Comments
 (0)