Skip to contentSkip to conversation

rust: miscdevice: fix write_iter safety docs

PATCH New Yilin Chen 1 participant 1 message Jul 7

Subsystems (2)
lore
Share & tools
lore

Yilin Chen

author
#0 lore raw

PATCH 1/1 rust: miscdevice: fix write_iter safety docs

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
---
 rust/kernel/miscdevice.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
rust/kernel/miscdevice.rs +1 -1
index 83ce50def..3abef1b85 100644
@@ -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,
Signature · 1 line
2.25.1