mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Vishal Moola (Fractile)" <vishal.moola@gmail.com>
To: Danilo Krummrich <dakr@kernel.org>
Cc: "Alice Ryhl" <aliceryhl@google.com>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	"Miguel Ojeda" <ojeda@kernel.org>,
	"Boqun Feng" <boqun@kernel.org>, "Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <lossin@kernel.org>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Daniel Almeida" <daniel.almeida@collabora.com>,
	"Tamir Duberstein" <tamird@kernel.org>,
	"Alexandre Courbot" <acourbot@nvidia.com>,
	"Onur Özkan" <work@onurozkan.dev>,
	"Asahi Lina" <lina+kernel@asahilina.net>,
	"Lyude Paul" <lyude@redhat.com>,
	dri-devel@lists.freedesktop.org, rust-for-linux@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rust: drm: ioctl: fix call to unsafe function
Date: Wed, 18 Nov 2026 16:57:22 +0000	[thread overview]
Message-ID: <av3Y8mTaRi7l-5iy@C422HJQPQG-Fractile> (raw)
In-Reply-To: <DMYH0CXPUTMP.J3AKN619TL34@kernel.org>

On Wed, Nov 18, 2026 at 05:17:41PM +0100, Danilo Krummrich wrote:
> 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?

I'm not sure? I'm compiling with rustc 1.98.1 (48a229cea 2026-09-01) (Fedora 1.98.1-1.fc44)
which gives me no errors like this.

Hopefully the build-bots catch it if there's a specific compiler version
that still dislikes it.

The following command shows a few other occurences in the kernel like this,
so if its still an issue I imagine it'd likely be caught somewhere:

	grep -rn -B1 '^\s*unsafe {' rust/kernel | grep '=$'

  reply	other threads:[~2026-11-18 16:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18 13:32 Vishal Moola (Fractile)
2026-11-18 15:29 ` Alice Ryhl
2026-11-18 15:55   ` Vishal Moola (Fractile)
2026-11-18 16:17 ` Danilo Krummrich
2026-11-18 16:57   ` Vishal Moola (Fractile) [this message]
2026-11-18 17:45     ` Gary Guo

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=av3Y8mTaRi7l-5iy@C422HJQPQG-Fractile \
    --to=vishal.moola@gmail.com \
    --cc=a.hindborg@kernel.org \
    --cc=acourbot@nvidia.com \
    --cc=airlied@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun@kernel.org \
    --cc=dakr@kernel.org \
    --cc=daniel.almeida@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gary@garyguo.net \
    --cc=lina+kernel@asahilina.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=lyude@redhat.com \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=simona@ffwll.ch \
    --cc=tamird@kernel.org \
    --cc=tmgross@umich.edu \
    --cc=work@onurozkan.dev \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®