From: Yilin Chen <1479826151@qq.com>
To: Andreas Hindborg <a.hindborg@kernel.org>,
Breno Leitao <leitao@debian.org>,
rust-for-linux@vger.kernel.org
Cc: Miguel Ojeda <ojeda@kernel.org>,
linux-kernel@vger.kernel.org, Yilin Chen <1479826151@qq.com>
Subject: [PATCH v2] rust: configfs: fix release safety documentation
Date: Wed, 8 Jul 2026 07:21:06 +0000 [thread overview]
Message-ID: <tencent_9FAFC60382D724C608F0F6BFABFC63BB6707@qq.com> (raw)
In-Reply-To: <tencent_928148924004787BD355EAB1EA3348E30106@qq.com>
ItemOperationsVTable<Group<Data>, Data>::release() receives a pointer
to a config_item, not a config_group.
The old Safety docs described the pointer as a config_group embedded in
Group<Parent>. Update them to state that the pointer must be the cg_item
field of a config_group embedded in a valid Group<Data>.
Assisted-by: Codex:GPT-5
Signed-off-by: Yilin Chen <1479826151@qq.com>
---
Changes in v2:
- Use the wording suggested in review: describe `this` as the `cg_item`
field of a `bindings::config_group` embedded in a valid `Group<Data>`.
rust/kernel/configfs.rs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/rust/kernel/configfs.rs b/rust/kernel/configfs.rs
index 2339c6467..b626eb7dc 100644
--- a/rust/kernel/configfs.rs
+++ b/rust/kernel/configfs.rs
@@ -437,8 +437,8 @@ impl<Data> ItemOperationsVTable<Group<Data>, Data>
{
/// # Safety
///
- /// `this` must be a pointer to a `bindings::config_group` embedded in a
- /// `Group<Parent>`.
+ /// `this` must be a pointer to the `cg_item` field of a `bindings::config_group` embedded in a
+ /// valid `Group<Data>`.
///
/// This function will destroy the pointee of `this`. The pointee of `this`
/// must not be accessed after the function returns.
--
2.25.1
next prev parent reply other threads:[~2026-07-08 7:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <MYhFFRyD6omXiyidE9Yx2_JbeF2ia3Y4dj4f4JkGdpRLNV6QDhXo0fqvH2pGd2L47vNQBemdYDSWrjCxJDBJxA==@protonmail.internalid>
2026-07-07 16:00 ` [PATCH] " Yilin Chen
2026-07-08 6:44 ` Andreas Hindborg
2026-07-08 7:21 ` Yilin Chen [this message]
2026-08-05 10:46 ` [PATCH v2] " Andreas Hindborg
2026-08-05 12:43 ` Andreas Hindborg
2026-09-29 10:21 ` Andreas Hindborg
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=tencent_9FAFC60382D724C608F0F6BFABFC63BB6707@qq.com \
--to=1479826151@qq.com \
--cc=a.hindborg@kernel.org \
--cc=leitao@debian.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
/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®