[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20260109080528.478731-1-pengfuyuan@kylinos.cn>
Date: Fri, 9 Jan 2026 16:05:27 +0800
From: pengfuyuan <pengfuyuan@...inos.cn>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: "Rafael J . Wysocki" <rafael@...nel.org>,
Danilo Krummrich <dakr@...nel.org>,
Miguel Ojeda <ojeda@...nel.org>,
Boqun Feng <boqun.feng@...il.com>,
Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <lossin@...nel.org>,
Andreas Hindborg <a.hindborg@...nel.org>,
Alice Ryhl <aliceryhl@...gle.com>,
Trevor Gross <tmgross@...ch.edu>,
rust-for-linux@...r.kernel.org,
linux-kernel@...r.kernel.org,
pengfuyuan <pengfuyuan@...inos.cn>
Subject: [PATCH v2 v2 0/1] Implement generic accessors for the platform data of a device
This is version 2 of the platform data accessor patch series.
Changes since v1:
- Changed return type from &T to &Opaque<T> as suggested by Danilo
- Marked the function as unsafe due to type mismatch risks (no runtime type checking)
- Made the API available for all device states, not just Device<Bound>
- Fixed documentation to use the standard "Safety" section
- Rewrote safety comments to explain why the conditions are upheld
Other notes:
1. AI usage disclosure: Yes, I used AI tools to assist with writing documentation
comments and analyzing existing Rust for Linux code patterns. The code
implementation itself was written by me, but I should have disclosed the AI
assistance. I will ensure proper disclosure in future submissions.
Thanks to Miguel Ojeda and Danilo for their detailed feedback.
Regarding the user/driver:
- The driver we're developing (a simplefb-like display driver) will indeed use
this API. Given the API needs redesign based on your feedback, I've redesigned
and resubmitted the platform data accessor API.
- However, since the driver is still under active development, it's not yet ready
for submission. I understand Linux kernel development requires no speculative
APIs (APIs must have actual users). I hope you could review this implementation
for feasibility (without merging it for now). If acceptable, I'll continue
driver development based on this API and submit both together once the driver
is complete.
Thank you again for your detailed review.
pengfuyuan (1):
rust: device: add platdata accessors
rust/kernel/device.rs | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
--
2.25.1
Powered by blists - more mailing lists