Skip to content

Commit 993647a

Browse files
ArvindYadavCsIngo Molnar
authored andcommitted
cpu/hotplug: Constify attribute_group structures
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 <arvind.yadav.cs@gmail.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: anna-maria@linutronix.de Cc: bigeasy@linutronix.de Cc: boris.ostrovsky@oracle.com Cc: rcochran@linutronix.de Link: http://lkml.kernel.org/r/f9079e94e12b36d245e7adbf67d312bc5d0250c6.1498737970.git.arvind.yadav.cs@gmail.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent 3e401f7 commit 993647a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/cpu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1629,7 +1629,7 @@ static struct attribute *cpuhp_cpu_attrs[] = {
16291629
NULL
16301630
};
16311631

1632-
static struct attribute_group cpuhp_cpu_attr_group = {
1632+
static const struct attribute_group cpuhp_cpu_attr_group = {
16331633
.attrs = cpuhp_cpu_attrs,
16341634
.name = "hotplug",
16351635
NULL
@@ -1661,7 +1661,7 @@ static struct attribute *cpuhp_cpu_root_attrs[] = {
16611661
NULL
16621662
};
16631663

1664-
static struct attribute_group cpuhp_cpu_root_attr_group = {
1664+
static const struct attribute_group cpuhp_cpu_root_attr_group = {
16651665
.attrs = cpuhp_cpu_root_attrs,
16661666
.name = "hotplug",
16671667
NULL

0 commit comments

Comments
 (0)