linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 1/2] samples/kobject: fix path comment
@ 2025-07-16  6:46 Meng Shao Liu
  2025-07-16  6:46 ` [PATCH v3 2/2] samples/kobject: make attribute_group const Meng Shao Liu
  0 siblings, 1 reply; 2+ messages in thread
From: Meng Shao Liu @ 2025-07-16  6:46 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>
---
V2 -> V3: Add missing version tag to subject line.
V1 -> V2: corrected my name and thread the patch series.

 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] 2+ messages in thread

* [PATCH v3 2/2] samples/kobject: make attribute_group const
  2025-07-16  6:46 [PATCH v3 1/2] samples/kobject: fix path comment Meng Shao Liu
@ 2025-07-16  6:46 ` Meng Shao Liu
  0 siblings, 0 replies; 2+ messages in thread
From: Meng Shao Liu @ 2025-07-16  6:46 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, visitorckw, 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().

Signed-off-by: Meng Shao Liu <sau525@gmail.com>
---
V2 -> V3: Add missing version tag to subject line.
V1 -> V2: corrected my name, thread the patch series, and remove
incorrect commit message "No functional change".

 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] 2+ messages in thread

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

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-16  6:46 [PATCH v3 1/2] samples/kobject: fix path comment Meng Shao Liu
2025-07-16  6:46 ` [PATCH v3 2/2] samples/kobject: make attribute_group const Meng Shao Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).