mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Danilo Krummrich <dakr@kernel.org>
To: Gary Guo <gary@garyguo.net>
Cc: "Janne Grunau" <j@jannau.net>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Miguel Ojeda" <miguel.ojeda.sandonis@gmail.com>,
	"Daniel Almeida" <daniel.almeida@collabora.com>,
	"Miguel Ojeda" <ojeda@kernel.org>,
	"Boqun Feng" <boqun@kernel.org>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <lossin@kernel.org>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Tamir Duberstein" <tamird@kernel.org>,
	"Alexandre Courbot" <acourbot@nvidia.com>,
	"Onur Özkan" <work@onurozkan.dev>,
	nova-gpu@lists.linux.dev, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org
Subject: Re: [PATCH 1/2] rust: drm: ioctl: return Result<i32> from ioctl handlers
Date: Mon, 30 Nov 2026 17:04:06 +0100	[thread overview]
Message-ID: <f907a15f-0c88-4c5a-80e8-c11ee90557ac@kernel.org> (raw)
In-Reply-To: <DN8NMBGU6CQC.2YBONZV859BTY@garyguo.net>

On 11/30/26 4:35 PM, Gary Guo wrote:
> I asked a clanker to search for the codebase (and I verified), and there're a
> few ioctls that return non-zero on success:
> 
> - DRM_IOCTL_I915_PERF_OPEN -- returning a file descriptor
> - DRM_IOCTL_I915_PERF_ADD_CONFIG -- returning a OA config ID
> - DRM_IOCTL_XE_OBSERVATION -- returning FD or OA config ID
> - DRM_IOCTL_MSM_PERFCNTR_CONFIG -- returning a FD
> 
> All of them are driver-specific ioctls and according to the clanker none of the
> core ioctls return non-zero on success (unverified). 
> 
> I think we can define a trait for allowed return values perhaps? Initially just
> implement it for () which converts to 0, and we can add more when it's needed in
> the future.
I think we should keep it simple and just return Result for now; it seems unlikely
we ever need something else.

  reply	other threads:[~2026-11-30 16:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30 10:17 [PATCH 0/2] rust: drm: ioctl: make DRM ioctls easier to understand Alice Ryhl
2026-11-30 10:17 ` [PATCH 1/2] rust: drm: ioctl: return Result<i32> from ioctl handlers Alice Ryhl
2026-11-30 11:43   ` Janne Grunau
2026-11-30 12:33     ` Alice Ryhl
2026-11-30 11:48   ` Miguel Ojeda
2026-11-30 12:32     ` Alice Ryhl
2026-11-30 14:19       ` Janne Grunau
2026-11-30 15:35         ` Gary Guo
2026-11-30 16:04           ` Danilo Krummrich [this message]
2026-11-30 13:15     ` Gary Guo
2026-11-30 10:17 ` [PATCH 2/2] rust: drm: ioctl: document declare_drm_ioctls! arguments and assertions Alice Ryhl
2026-11-30 11:45   ` Janne Grunau

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=f907a15f-0c88-4c5a-80e8-c11ee90557ac@kernel.org \
    --to=dakr@kernel.org \
    --cc=a.hindborg@kernel.org \
    --cc=acourbot@nvidia.com \
    --cc=aliceryhl@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun@kernel.org \
    --cc=daniel.almeida@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gary@garyguo.net \
    --cc=j@jannau.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=miguel.ojeda.sandonis@gmail.com \
    --cc=nova-gpu@lists.linux.dev \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --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®