mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Gary Guo" <gary@garyguo.net>
To: "Miguel Ojeda" <miguel.ojeda.sandonis@gmail.com>,
	"Alice Ryhl" <aliceryhl@google.com>
Cc: "Danilo Krummrich" <dakr@kernel.org>,
	"Daniel Almeida" <daniel.almeida@collabora.com>,
	"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>,
	"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 13:15:49 +0000	[thread overview]
Message-ID: <DN8KNNO02144.2THNNXT8PHD31@garyguo.net> (raw)
In-Reply-To: <CANiq72nJPNHpvJtYXHdiRnNRF_NE0hVOcfwyyP7W1UhwHdhh7w@mail.gmail.com>

On Mon Nov 30, 2026 at 11:48 AM GMT, Miguel Ojeda wrote:
> On Mon, Nov 30, 2026 at 11:18 AM Alice Ryhl <aliceryhl@google.com> wrote:
>>
>> While teaching the Rust for Linux course,
>
> Without context, people will not know what course it means. Maybe add
> the company name?
>
>> integer, so it's not clear what values about i32::MAX would mean.
>
> "above"
>
>> This means that there are two ways of returning a
>> negative value to userspace (either Err(err) or Ok(-x)), and that
>> userspace cannot distinguish whether the driver did one or the other.
>
> Yeah, I am not thrilled about having two ways that look different but
> do the same.

Yeah I agree, I think the EB of overflowing return turned to ERANGE is better
than two ways of returning an errno.

Best,
Gary


  parent reply	other threads:[~2026-11-30 13:15 UTC|newest]

Thread overview: 10+ 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 13:15     ` Gary Guo [this message]
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=DN8KNNO02144.2THNNXT8PHD31@garyguo.net \
    --to=gary@garyguo.net \
    --cc=a.hindborg@kernel.org \
    --cc=acourbot@nvidia.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=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®