Skip to content

Commit

Permalink
ACPI / dock: constify attribute_group structure
Browse files Browse the repository at this point in the history
Functions working with attribute_groups provided by <linux/sysfs.h>
work with const attribute_group. These attribute_group structures do not
change at runtime so mark them as const.

File size before:
 text      data     bss     dec     hex filename
 7902      3528      64   11494    2ce6 drivers/acpi/dock.o

File size after:
 text      data     bss     dec     hex filename
 7998      3432      64   11494    2ce6 drivers/acpi/dock.o

This change was made with the help of Coccinelle.

Signed-off-by: Amitoj Kaur Chawla <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
  • Loading branch information
musicakc authored and rafaeljw committed Aug 3, 2017
1 parent ed3beaa commit 19dc713
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/acpi/dock.c
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ static struct attribute *dock_attributes[] = {
NULL
};

static struct attribute_group dock_attribute_group = {
static const struct attribute_group dock_attribute_group = {
.attrs = dock_attributes
};

Expand Down

0 comments on commit 19dc713

Please sign in to comment.