rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rust/drm/gem: initialize callbacks with ..pin_init::zeroed()
@ 2026-09-08 17:54 Klara Modin
       [not found] ` <20260908180555.0830E1F00A3A@smtp.kernel.org>
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Klara Modin @ 2026-09-08 17:54 UTC (permalink / raw)
  To: David Airlie, Simona Vetter, Danilo Krummrich, Alice Ryhl
  Cc: Miguel Ojeda, Alex Deucher, Mukul Joshi, Felix Kuehling,
	Christian König, Thorsten Leemhuis, Manuel Ebner, Gary Guo,
	dri-devel, rust-for-linux, amd-gfx, linux-kernel, Klara Modin

When the commit b67d2d039f64 ("drm/gem: Add callback for when handle
count goes to 0") added the handle_free callback, it did not update the
rust abstraction, which will cause a build failure when that is enabled.
Rather than just adding another None initializer, use
..pin_init::zeroed() to make all unlisted callbacks None, and remove the
existing None-initializations.

Fixes: b67d2d039f64 ("drm/gem: Add callback for when handle count goes to 0")
Reported-by: Thorsten Leemhuis <linux@leemhuis.info>
Closes: https://lore.kernel.org/all/aaef18cd-ab55-4fb8-8563-ca3a5ea9cbc6@leemhuis.info
Suggested-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Klara Modin <klarasmodin@gmail.com>
---
 rust/kernel/drm/gem/mod.rs | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/rust/kernel/drm/gem/mod.rs b/rust/kernel/drm/gem/mod.rs
index 80d8f524f9d5..af8274134a71 100644
--- a/rust/kernel/drm/gem/mod.rs
+++ b/rust/kernel/drm/gem/mod.rs
@@ -266,18 +266,8 @@ impl<T: DriverObject, Ctx: DeviceContext> Object<T, Ctx> {
         free: Some(Self::free_callback),
         open: Some(open_callback::<T>),
         close: Some(close_callback::<T>),
-        print_info: None,
-        export: None,
-        pin: None,
-        unpin: None,
-        get_sg_table: None,
-        vmap: None,
-        vunmap: None,
-        mmap: None,
-        status: None,
         vm_ops: core::ptr::null_mut(),
-        evict: None,
-        rss: None,
+        ..pin_init::zeroed()
     };
 
     /// Returns the `Device` that owns this GEM object.
-- 
2.55.0


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

end of thread, other threads:[~2026-09-09  8:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-08 17:54 [PATCH] rust/drm/gem: initialize callbacks with ..pin_init::zeroed() Klara Modin
     [not found] ` <20260908180555.0830E1F00A3A@smtp.kernel.org>
2026-09-08 18:57   ` Klara Modin
2026-09-08 19:09     ` Klara Modin
2026-09-08 19:25       ` Klara Modin
2026-09-08 20:50 ` Gary Guo
2026-09-09  8:01 ` Thomas Zimmermann
2026-09-09  8:05   ` Miguel Ojeda
2026-09-09  8:11     ` Thomas Zimmermann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).