All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] samples/kobject: fix path comment
@ 2025-07-16  3:07 Meng Shao Liu
  2025-07-16  3:07 ` [PATCH 2/2] samples/kobject: make attribute_group const Meng Shao Liu
  2025-07-16  4:53 ` [PATCH 1/2] samples/kobject: fix path comment Greg KH
  0 siblings, 2 replies; 6+ messages in thread
From: Meng Shao Liu @ 2025-07-16  3:07 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, visitorckw, Meng Shao Liu

The introductory comment still says the example creates
/sys/kernel/kobject-example, but the code actually creates
/sys/kernel/kobject_example.

Update both comments to reflect the actual sysfs paths. Also,
fix "tree"->"three" typo in kset-example.c.

Signed-off-by: Meng Shao Liu <sau525@gmail.com>
---
 samples/kobject/kobject-example.c | 2 +-
 samples/kobject/kset-example.c    | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/samples/kobject/kobject-example.c b/samples/kobject/kobject-example.c
index c9c3db197..e6d7fc18e 100644
--- a/samples/kobject/kobject-example.c
+++ b/samples/kobject/kobject-example.c
@@ -13,7 +13,7 @@
 
 /*
  * This module shows how to create a simple subdirectory in sysfs called
- * /sys/kernel/kobject-example  In that directory, 3 files are created:
+ * /sys/kernel/kobject_example  In that directory, 3 files are created:
  * "foo", "baz", and "bar".  If an integer is written to these files, it can be
  * later read out of it.
  */
diff --git a/samples/kobject/kset-example.c b/samples/kobject/kset-example.c
index 552d7e363..579ce1502 100644
--- a/samples/kobject/kset-example.c
+++ b/samples/kobject/kset-example.c
@@ -14,8 +14,8 @@
 
 /*
  * This module shows how to create a kset in sysfs called
- * /sys/kernel/kset-example
- * Then tree kobjects are created and assigned to this kset, "foo", "baz",
+ * /sys/kernel/kset_example
+ * Then three kobjects are created and assigned to this kset, "foo", "baz",
  * and "bar".  In those kobjects, attributes of the same name are also
  * created and if an integer is written to these files, it can be later
  * read out of it.
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread
* [PATCH 2/2] samples/kobject: make attribute_group const
@ 2025-07-15 14:30 Meng-Shao.Liu
  2025-07-15 14:54 ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Meng-Shao.Liu @ 2025-07-15 14:30 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, Meng-Shao.Liu

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

No functional change.

Signed-off-by: Meng-Shao.Liu <sau525@gmail.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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-07-16  4:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-16  3:07 [PATCH 1/2] samples/kobject: fix path comment Meng Shao Liu
2025-07-16  3:07 ` [PATCH 2/2] samples/kobject: make attribute_group const Meng Shao Liu
2025-07-16  4:53   ` Greg KH
2025-07-16  4:53 ` [PATCH 1/2] samples/kobject: fix path comment Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2025-07-15 14:30 [PATCH 2/2] samples/kobject: make attribute_group const Meng-Shao.Liu
2025-07-15 14:54 ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.