]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
samples/kobject: make attribute_group const
authorMeng Shao Liu <sau525@gmail.com>
Wed, 16 Jul 2025 06:46:29 +0000 (14:46 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Jul 2025 11:32:53 +0000 (13:32 +0200)
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>
samples/kobject/kobject-example.c

index e6d7fc18e4339da67efc5bcb759bc9745869c784..36d87ca0bee24729ec44edb64064aba44975e977 100644 (file)
@@ -102,7 +102,7 @@ static struct attribute *attrs[] = {
  * created for the attributes with the directory being the name of the
  * attribute group.
  */
-static struct attribute_group attr_group = {
+static const struct attribute_group attr_group = {
        .attrs = attrs,
 };