[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <56a3e16e-d686-440e-86b7-ee41f9d19fb1@app.fastmail.com>
Date: Thu, 23 Mar 2023 13:18:15 +0100
From: "Arnd Bergmann" <arnd@...db.de>
To: "Asahi Lina" <lina@...hilina.net>,
"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 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.
Arnd
Powered by blists - more mailing lists