Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

PM / devfreq: 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
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>

authored by

Arvind Yadav and committed by
MyungJoo Ham
37d644aa 9e578b37

+1 -1
+1 -1
drivers/devfreq/governor_userspace.c
··· 86 86 &dev_attr_set_freq.attr, 87 87 NULL, 88 88 }; 89 - static struct attribute_group dev_attr_group = { 89 + static const struct attribute_group dev_attr_group = { 90 90 .name = "userspace", 91 91 .attrs = dev_entries, 92 92 };