Re: [PATCH] rust: drm: ioctl: fix call to unsafe function

From: Danilo Krummrich

Date: Wed Nov 18 2026 - 11:18:07 EST


On Wed Nov 18, 2026 at 2:32 PM CET, Vishal Moola (Fractile) wrote:
> diff --git a/rust/kernel/drm/ioctl.rs b/rust/kernel/drm/ioctl.rs
> index 64af9eacc306..5a2e2f4f0e91 100644
> --- a/rust/kernel/drm/ioctl.rs
> +++ b/rust/kernel/drm/ioctl.rs
> @@ -152,7 +152,7 @@ macro_rules! declare_drm_ioctls {
> // dev/file match the current driver these ioctls are being declared
> // for, and it's not clear how to enforce this within the type system.
> let dev: &$crate::drm::device::Device<_, $crate::drm::Ioctl> =
> - $crate::drm::device::Device::from_raw(raw_dev);
> + unsafe { $crate::drm::device::Device::from_raw(raw_dev) };

I remember there has been at least one compiler version in the supported range
that complained when the safety comment isn't directly above the unsafe block.
Has this been fixed in the meantime?