All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rust: drm: fix GEM object pointer safety docs
@ 2026-07-07 16:02 Yilin Chen
  2026-07-07 16:07 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Yilin Chen @ 2026-07-07 16:02 UTC (permalink / raw)
  To: David Airlie, Simona Vetter, dri-devel, rust-for-linux
  Cc: Miguel Ojeda, Danilo Krummrich, linux-kernel, Yilin Chen

IntoGEMObject::from_raw() takes a drm_gem_object pointer.

Its Safety docs described the argument as a pointer to Self, which does
not match the function signature. Update the docs to point to the actual 
pointer type accepted by the API.

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

diff --git a/rust/kernel/drm/gem/mod.rs b/rust/kernel/drm/gem/mod.rs
index c8b66d816..90b256093 100644
--- a/rust/kernel/drm/gem/mod.rs
+++ b/rust/kernel/drm/gem/mod.rs
@@ -118,7 +118,7 @@ pub trait IntoGEMObject: Sized + super::private::Sealed + AlwaysRefCounted {
     ///
     /// # Safety
     ///
-    /// - `self_ptr` must be a valid pointer to `Self`.
+    /// - `self_ptr` must be a valid pointer to `struct drm_gem_object`.
     /// - The caller promises that holding the immutable reference returned by this function does
     ///   not violate rust's data aliasing rules and remains valid throughout the lifetime of `'a`.
     unsafe fn from_raw<'a>(self_ptr: *mut bindings::drm_gem_object) -> &'a Self;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-07-07 16:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-07 16:02 [PATCH] rust: drm: fix GEM object pointer safety docs Yilin Chen
2026-07-07 16:07 ` sashiko-bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.