media: imon: constify attribute_group structures
authorArvind Yadav <arvind.yadav.cs@gmail.com>
Fri, 7 Jul 2017 08:15:12 +0000 (04:15 -0400)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Sun, 20 Aug 2017 13:42:01 +0000 (09:42 -0400)
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 <arvind.yadav.cs@gmail.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/rc/imon.c

index bd76534a27494eec8b7daec091ae3eb2339a968c..717ba782d7a7eca9bbd547ba68cd586e415b3a10 100644 (file)
@@ -911,7 +911,7 @@ static struct attribute *imon_display_sysfs_entries[] = {
        NULL
 };
 
-static struct attribute_group imon_display_attr_group = {
+static const struct attribute_group imon_display_attr_group = {
        .attrs = imon_display_sysfs_entries
 };
 
@@ -920,7 +920,7 @@ static struct attribute *imon_rf_sysfs_entries[] = {
        NULL
 };
 
-static struct attribute_group imon_rf_attr_group = {
+static const struct attribute_group imon_rf_attr_group = {
        .attrs = imon_rf_sysfs_entries
 };