mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Meng Shao Liu <sau525@gmail.com>
To: gregkh@linuxfoundation.org
Cc: linux-kernel@vger.kernel.org, visitorckw@gmail.com,
	Meng Shao Liu <sau525@gmail.com>
Subject: [PATCH v3 2/2] samples/kobject: make attribute_group const
Date: Wed, 16 Jul 2025 14:46:29 +0800	[thread overview]
Message-ID: <dc94227eaf337a2b92ab77dffa0da9f7f1f84c4e.1752646650.git.sau525@gmail.com> (raw)
In-Reply-To: <5be61d284a1850f573658f1c105f0b6062e41332.1752646650.git.sau525@gmail.com>

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


      reply	other threads:[~2025-07-16  6:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dc94227eaf337a2b92ab77dffa0da9f7f1f84c4e.1752646650.git.sau525@gmail.com \
    --to=sau525@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=visitorckw@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®