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

samples/kobject: make attribute_group const

The attr_group structures are allocated once and never modified at
runtime. Also to match the const‑qualified parameter of
sysfs_create_group().

Signed-off-by: Meng Shao Liu <sau525@gmail.com>
Link: https://lore.kernel.org/r/dc94227eaf337a2b92ab77dffa0da9f7f1f84c4e.1752646650.git.sau525@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Meng Shao Liu and committed by
Greg Kroah-Hartman
f751fe2a 42573e4d

+1 -1
+1 -1
samples/kobject/kobject-example.c
··· 102 102 * created for the attributes with the directory being the name of the 103 103 * attribute group. 104 104 */ 105 - static struct attribute_group attr_group = { 105 + static const struct attribute_group attr_group = { 106 106 .attrs = attrs, 107 107 }; 108 108