]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
PM / devfreq: constify attribute_group structures.
authorArvind Yadav <arvind.yadav.cs@gmail.com>
Mon, 3 Jul 2017 10:10:04 +0000 (15:40 +0530)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Thu, 6 Jul 2017 01:17:24 +0000 (10:17 +0900)
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
    621     176       0     797     31d drivers/devfreq/governor_userspace.o

File size After adding 'const':
   text    data     bss     dec     hex filename
   670     144       0     814     32e drivers/devfreq/governor_userspace.o

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
drivers/devfreq/governor_userspace.c

index 176976068bcd1552d0a625ea47ebdf72812b4c6b..77028c27593c635d821fab28eea57c0084a89346 100644 (file)
@@ -86,7 +86,7 @@ static struct attribute *dev_entries[] = {
        &dev_attr_set_freq.attr,
        NULL,
 };
-static struct attribute_group dev_attr_group = {
+static const struct attribute_group dev_attr_group = {
        .name   = "userspace",
        .attrs  = dev_entries,
 };