Re: [PATCH 1/2] rust: drm: ioctl: return Result<i32> from ioctl handlers
From: Gary Guo
Date: Mon Nov 30 2026 - 08:16:06 EST
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@xxxxxxxxxx> 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