Skip to content

Commit

Permalink
cpu/hotplug: 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
  12582	  15361	     20	  27963	   6d3b	kernel/cpu.o

File size After adding 'const':
   text	   data	    bss	    dec	    hex	filename
  12710	  15265	     20	  27995	   6d5b	kernel/cpu.o

Signed-off-by: Arvind Yadav <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Link: http://lkml.kernel.org/r/f9079e94e12b36d245e7adbf67d312bc5d0250c6.1498737970.git.arvind.yadav.cs@gmail.com
Signed-off-by: Ingo Molnar <[email protected]>
  • Loading branch information
ArvindYadavCs authored and Ingo Molnar committed Jun 30, 2017
1 parent 3e401f7 commit 993647a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1629,7 +1629,7 @@ static struct attribute *cpuhp_cpu_attrs[] = {
NULL
};

static struct attribute_group cpuhp_cpu_attr_group = {
static const struct attribute_group cpuhp_cpu_attr_group = {
.attrs = cpuhp_cpu_attrs,
.name = "hotplug",
NULL
Expand Down Expand Up @@ -1661,7 +1661,7 @@ static struct attribute *cpuhp_cpu_root_attrs[] = {
NULL
};

static struct attribute_group cpuhp_cpu_root_attr_group = {
static const struct attribute_group cpuhp_cpu_root_attr_group = {
.attrs = cpuhp_cpu_root_attrs,
.name = "hotplug",
NULL
Expand Down

0 comments on commit 993647a

Please sign in to comment.