Skip to content

Commit

Permalink
PM / sleep: constify attribute_group structures
Browse files Browse the repository at this point in the history
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
   3802	    624	     32	   4458	   116a	kernel/power/main.o

File size After adding 'const':
   text	   data	    bss	    dec	    hex	filename
   3866	    560	     32	   4458	   116a	kernel/power/main.o

Signed-off-by: Arvind Yadav <[email protected]>
Acked-by: Pavel Machek <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
  • Loading branch information
ArvindYadavCs authored and rafaeljw committed Jul 4, 2017
1 parent 59494fe commit 1d0c6e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/power/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,7 @@ static struct attribute * g[] = {
NULL,
};

static struct attribute_group attr_group = {
static const struct attribute_group attr_group = {
.attrs = g,
};

Expand Down

0 comments on commit 1d0c6e5

Please sign in to comment.