[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1fad33a2-cba4-8ae9-0966-67ea24177149@asahilina.net>
Date: Thu, 23 Mar 2023 21:24:31 +0900
From: Asahi Lina <lina@...hilina.net>
To: Arnd Bergmann <arnd@...db.de>, Miguel Ojeda <ojeda@...nel.org>,
Alex Gaynor <alex.gaynor@...il.com>,
Wedson Almeida Filho <wedsonaf@...il.com>,
Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>
Cc: linux-kernel@...r.kernel.org, rust-for-linux@...r.kernel.org,
asahi@...ts.linux.dev, Linux-Arch <linux-arch@...r.kernel.org>
Subject: Re: [PATCH v2] rust: ioctl: Add ioctl number manipulation functions
On 23/03/2023 21.18, Arnd Bergmann wrote:
> On Thu, Mar 23, 2023, at 13:08, Asahi Lina wrote:
>> Changes in v2:
>> - Changed from assert!() to build_assert!() (static_assert!() can't work here)
> ...
>> +/// Build an ioctl number, analogous to the C macro of the same name.
>> +const fn _IOC(dir: u32, ty: u32, nr: u32, size: usize) -> u32 {
>> + core::assert!(dir <= bindings::_IOC_DIRMASK);
>> + core::assert!(ty <= bindings::_IOC_TYPEMASK);
>> + core::assert!(nr <= bindings::_IOC_NRMASK);
>> + core::assert!(size <= (bindings::_IOC_SIZEMASK as usize));
>
> Just to make sure: did you actually change it according
> to the changelog? It still looks like a runtime assertion
> to me, but I don't really understand any rust.
Umm... I'm not sure what happened there.
Sorry, I'll resend it. I ran into some unrelated pain with bindgen
versions while trying to compile-test this, and along the way I must
have somehow dropped the actual v2 change...
~~ Lina
Powered by blists - more mailing lists