All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Gary Guo" <gary@garyguo.net>
To: "Klara Modin" <klarasmodin@gmail.com>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	"Danilo Krummrich" <dakr@kernel.org>,
	"Alice Ryhl" <aliceryhl@google.com>
Cc: "Miguel Ojeda" <ojeda@kernel.org>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Mukul Joshi" <mukul.joshi@amd.com>,
	"Felix Kuehling" <felix.kuehling@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	"Thorsten Leemhuis" <linux@leemhuis.info>,
	"Manuel Ebner" <manuelebner@mailbox.org>,
	"Gary Guo" <gary@garyguo.net>,
	dri-devel@lists.freedesktop.org, rust-for-linux@vger.kernel.org,
	amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rust/drm/gem: initialize callbacks with ..pin_init::zeroed()
Date: Tue, 08 Sep 2026 21:50:51 +0100	[thread overview]
Message-ID: <DLA8CU2LX62I.3PVH3HG52YA2J@garyguo.net> (raw)
In-Reply-To: <20260908175427.47207-1-klarasmodin@gmail.com>

On Tue Sep 8, 2026 at 6:54 PM BST, Klara Modin wrote:
> 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(),

This line can be gone too.

Best,
Gary

> -        evict: None,
> -        rss: None,
> +        ..pin_init::zeroed()
>      };
>  
>      /// Returns the `Device` that owns this GEM object.



  parent reply	other threads:[~2026-09-08 20:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-08 17:54 [PATCH] rust/drm/gem: initialize callbacks with ..pin_init::zeroed() Klara Modin
2026-09-08 18:05 ` sashiko-bot
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 [this message]
2026-09-09  8:01 ` Thomas Zimmermann
2026-09-09  8:05   ` Miguel Ojeda
2026-09-09  8:11     ` Thomas Zimmermann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DLA8CU2LX62I.3PVH3HG52YA2J@garyguo.net \
    --to=gary@garyguo.net \
    --cc=airlied@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=aliceryhl@google.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=dakr@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=felix.kuehling@amd.com \
    --cc=klarasmodin@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@leemhuis.info \
    --cc=manuelebner@mailbox.org \
    --cc=mukul.joshi@amd.com \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=simona@ffwll.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.