Re: [PATCH] rust: drm: ioctl: wrap `Device::from_raw` in an `unsafe` block

From: Nicolás Antinori

Date: Mon Oct 12 2026 - 18:41:07 EST


Hello! some nits about the patch body

On Wed Oct 7, 2026 at 6:17 PM -03, spidermana wrote:
> `declare_drm_ioctls!` generates an `unsafe extern "C" fn` per ioctl. Inside
> it, four unsafe operations are performed, while the call to `Device::from_raw()` relies on the enclosing
> `unsafe fn` body instead.
>
> Both forms are legal, but the kernel builds all Rust code with `-Dunsafe_op_in_unsafe_fn`, which asks for the explicit block.
> The lint does not fire here because the macro is defined in the `kernel` crate and expanded in the
> driver crates, and rustc suppresses lints for code coming from another crate's macro.
>
> The patch is to wrap the call in an unsafe block, keeping the existing SAFETY comment. No functional change.

The lines in the message are usually wrapped at column 75 [1]. One thing
I do is writing it in vim and if I see that the paragraph exceeds the
limit, I put the cursor over it and type in normal mode gqip. This
auto-wrapps it.

>
> Signed-off-by: spidermana <xuyiwen14@xxxxxxxxx>

Normally, a full legal name is used for signing patches [2].

If you are going to re-send the patch and nothing changes, you can use
[PATCH RESEND] tag.

Hope that helps!

Regards,
Nicolás

[1] https://docs.kernel.org/process/submitting-patches.html#the-canonical-patch-format
[2] https://docs.kernel.org/process/submitting-patches.html#sign-your-work-the-developer-s-certificate-of-origin