Re: [PATCH] rust: drm: gem: shmem: Drop unused unsafe for vm_ops assignment
From: Gary Guo
Date: Wed Nov 25 2026 - 17:13:03 EST
On Wed Nov 25, 2026 at 12:24 PM GMT, Janne Grunau wrote:
> The assignment uses a raw const pointer referencing the static const
> drm_gem_shmem_vm_ops from C side. This is safe since Rust 1.82.0 as
> stated by the #[allow(unused_unsafe)]` attribute.
> This was added in parallel with commit f32fb9c58a5b ("rust: bump Rust
> minimum supported version to 1.85.0 (Debian Trixie)") for Linux v7.1.
> Drop the unsafe, the SAFETY comment and the attribute as they are always
> unused with Rust 1.85.0 and later.
>
> Signed-off-by: Janne Grunau <j@xxxxxxxxxx>
Reviewed-by: Gary Guo <gary@xxxxxxxxxxx>
> ---
> randomly spotted while looking at the source, no other
> `#[allow(unused_unsafe)]` in rust/kernel can be dropped for the same
> reason.
> Tested with rust 1.85.1 and 1.100.0
> ---
> rust/kernel/drm/gem/shmem.rs | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)