From: "Arnd Bergmann" <arnd@arndb.de>
To: "Asahi Lina" <lina@asahilina.net>,
"Miguel Ojeda" <ojeda@kernel.org>,
"Alex Gaynor" <alex.gaynor@gmail.com>,
"Wedson Almeida Filho" <wedsonaf@gmail.com>,
"Boqun Feng" <boqun.feng@gmail.com>,
"Gary Guo" <gary@garyguo.net>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>
Cc: linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org,
asahi@lists.linux.dev, Linux-Arch <linux-arch@vger.kernel.org>
Subject: Re: [PATCH v2] rust: ioctl: Add ioctl number manipulation functions
Date: Thu, 23 Mar 2023 13:18:15 +0100 [thread overview]
Message-ID: <56a3e16e-d686-440e-86b7-ee41f9d19fb1@app.fastmail.com> (raw)
In-Reply-To: <20230224-rust-ioctl-v2-1-5325e76a92df@asahilina.net>
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
next prev parent reply other threads:[~2023-03-23 12:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-23 12:08 Asahi Lina
2023-03-23 12:18 ` Arnd Bergmann [this message]
2023-03-23 12:24 ` Asahi Lina
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=56a3e16e-d686-440e-86b7-ee41f9d19fb1@app.fastmail.com \
--to=arnd@arndb.de \
--cc=alex.gaynor@gmail.com \
--cc=asahi@lists.linux.dev \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun.feng@gmail.com \
--cc=gary@garyguo.net \
--cc=lina@asahilina.net \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=wedsonaf@gmail.com \
/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®