Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86/platform/uv: Constify static attribute_group struct

The only use of base_attr_group and hubless_base_attr_group is to pass
their addresses to sysfs_create_group() and sysfs_remove_group(), both
which takes pointers to const attribute_group structs. Make them const
to allow the compiler to put them in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Reviewed-by: Justin Ernst <justin.ernst@hpe.com>
Link: https://lore.kernel.org/r/20210605203807.60547-5-rikard.falkeborn@gmail.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>

authored by

Rikard Falkeborn and committed by
Hans de Goede
77d06ec6 62ef9691

+2 -2
+2 -2
drivers/platform/x86/uv_sysfs.c
··· 778 778 NULL, 779 779 }; 780 780 781 - static struct attribute_group base_attr_group = { 781 + static const struct attribute_group base_attr_group = { 782 782 .attrs = base_attrs 783 783 }; 784 784 ··· 823 823 NULL, 824 824 }; 825 825 826 - static struct attribute_group hubless_base_attr_group = { 826 + static const struct attribute_group hubless_base_attr_group = { 827 827 .attrs = hubless_base_attrs 828 828 }; 829 829