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

most: core: Constify static attribute_group structs

The only usage of these is to put their addresses in arrays of pointers
to const attribute_groups. Make them const to allow the compiler to put
them in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Link: https://lore.kernel.org/r/20210108221512.18811-1-rikard.falkeborn@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Rikard Falkeborn and committed by
Greg Kroah-Hartman
26c2e922 e4240253

+3 -3
+3 -3
drivers/most/core.c
··· 379 379 NULL, 380 380 }; 381 381 382 - static struct attribute_group channel_attr_group = { 382 + static const struct attribute_group channel_attr_group = { 383 383 .attrs = channel_attrs, 384 384 .is_visible = channel_attr_is_visible, 385 385 }; ··· 436 436 NULL, 437 437 }; 438 438 439 - static struct attribute_group interface_attr_group = { 439 + static const struct attribute_group interface_attr_group = { 440 440 .attrs = interface_attrs, 441 441 }; 442 442 ··· 718 718 NULL, 719 719 }; 720 720 721 - static struct attribute_group mc_attr_group = { 721 + static const struct attribute_group mc_attr_group = { 722 722 .attrs = mc_attrs, 723 723 }; 724 724