[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <170a918a8e14b1e0c003b6e277cd5813631c2749.1752634732.git.sau525@gmail.com>
Date: Wed, 16 Jul 2025 11:07:34 +0800
From: Meng Shao Liu <sau525@...il.com>
To: gregkh@...uxfoundation.org
Cc: linux-kernel@...r.kernel.org,
visitorckw@...il.com,
Meng Shao Liu <sau525@...il.com>
Subject: [PATCH 2/2] 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@...il.com>
---
samples/kobject/kobject-example.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/samples/kobject/kobject-example.c b/samples/kobject/kobject-example.c
index e6d7fc18e..36d87ca0b 100644
--- a/samples/kobject/kobject-example.c
+++ b/samples/kobject/kobject-example.c
@@ -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,
};
--
2.43.0
Powered by blists - more mailing lists