]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
platform/x86: alienware-wmi: constify attribute_group structures.
authorArvind Yadav <arvind.yadav.cs@gmail.com>
Tue, 11 Jul 2017 10:48:17 +0000 (16:18 +0530)
committerDarren Hart (VMware) <dvhart@infradead.org>
Tue, 11 Jul 2017 16:22:52 +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
   6932    1016      48    7996    1f3c drivers/platform/x86/alienware-wmi.o

File size After adding 'const':
   text    data     bss     dec     hex filename
   7060     888      48    7996    1f64 drivers/platform/x86/alienware-wmi.o

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

index 9866fec78c1c93138934967f1309014dfae89390..0831b428c217549f6d42a6d1543d4ed0cb539535 100644 (file)
@@ -604,7 +604,7 @@ static struct attribute *hdmi_attrs[] = {
        NULL,
 };
 
-static struct attribute_group hdmi_attribute_group = {
+static const struct attribute_group hdmi_attribute_group = {
        .name = "hdmi",
        .attrs = hdmi_attrs,
 };
@@ -660,7 +660,7 @@ static struct attribute *amplifier_attrs[] = {
        NULL,
 };
 
-static struct attribute_group amplifier_attribute_group = {
+static const struct attribute_group amplifier_attribute_group = {
        .name = "amplifier",
        .attrs = amplifier_attrs,
 };
@@ -741,7 +741,7 @@ static struct attribute *deepsleep_attrs[] = {
        NULL,
 };
 
-static struct attribute_group deepsleep_attribute_group = {
+static const struct attribute_group deepsleep_attribute_group = {
        .name = "deepsleep",
        .attrs = deepsleep_attrs,
 };