]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
platform/x86: panasonic-laptop: constify attribute_group structures.
authorArvind Yadav <arvind.yadav.cs@gmail.com>
Tue, 11 Jul 2017 10:48:18 +0000 (16:18 +0530)
committerDarren Hart (VMware) <dvhart@infradead.org>
Tue, 11 Jul 2017 16:22:53 +0000 (09:22 -0700)
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
   2505     600       4    3109     c25 drivers/platform/x86/panasonic-laptop.o

File size After adding 'const':
   text    data     bss     dec     hex filename
   2569     536       4    3109     c25 drivers/platform/x86/panasonic-laptop.o

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
drivers/platform/x86/panasonic-laptop.c

index 76b0a58e205ba49c735ec6b93805ad6bf9956b11..5c39b3211709bca675216625786bf3967e477ba9 100644 (file)
@@ -437,7 +437,7 @@ static struct attribute *pcc_sysfs_entries[] = {
        NULL,
 };
 
-static struct attribute_group pcc_attr_group = {
+static const struct attribute_group pcc_attr_group = {
        .name   = NULL,         /* put in device directory */
        .attrs  = pcc_sysfs_entries,
 };