Rust for Linux List
 help / color / mirror / Atom feed
* [PATCH] rust: miscdevice: fix write_iter safety docs
@ 2026-07-07 16:10 Yilin Chen
  0 siblings, 0 replies; only message in thread
From: Yilin Chen @ 2026-07-07 16:10 UTC (permalink / raw)
  To: Arnd Bergmann, Greg Kroah-Hartman, rust-for-linux
  Cc: Miguel Ojeda, linux-kernel, Yilin Chen

The write_iter callback consumes data from the supplied iov_iter and
wraps it as an IovIterSource.

Its Safety docs required a valid iov_iter for writing, but the
implementation and the IovIterSource contract require one that is valid
for reading. Update the docs to match that direction.

Assisted-by: Codex:GPT-5
Signed-off-by: Yilin Chen <1479826151@qq.com>
---
 rust/kernel/miscdevice.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rust/kernel/miscdevice.rs b/rust/kernel/miscdevice.rs
index 83ce50def..3abef1b85 100644
--- a/rust/kernel/miscdevice.rs
+++ b/rust/kernel/miscdevice.rs
@@ -289,7 +289,7 @@ impl<T: MiscDevice> MiscdeviceVTable<T> {
     /// # Safety
     ///
     /// `kiocb` must be correspond to a valid file that is associated with a
-    /// `MiscDeviceRegistration<T>`. `iter` must be a valid `struct iov_iter` for writing.
+    /// `MiscDeviceRegistration<T>`. `iter` must be a valid `struct iov_iter` for reading.
     unsafe extern "C" fn write_iter(
         kiocb: *mut bindings::kiocb,
         iter: *mut bindings::iov_iter,
-- 
2.25.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-07-07 16:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-07 16:10 [PATCH] rust: miscdevice: fix write_iter safety docs Yilin Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox