Re: [PATCH v3] rust: ioctl: Add ioctl number manipulation functions

From: Asahi Lina
Date: Thu Mar 23 2023 - 10:01:36 EST


On 23/03/2023 22.05, Miguel Ojeda wrote:
On Thu, Mar 23, 2023 at 1:34 PM Asahi Lina <lina@xxxxxxxxxxxxx> wrote:

Changes in v3:
- Actually made the change intended in v2.
- Link to v2: https://lore.kernel.org/r/20230224-rust-ioctl-v2-1-5325e76a92df@xxxxxxxxxxxxx

Changes in v2:
- Changed from assert!() to build_assert!() (static_assert!() can't work
here)
- Link to v1: https://lore.kernel.org/r/20230224-rust-ioctl-v1-1-5142d365a934@xxxxxxxxxxxxx

It seems `#[inline(always)]` got added to a few of those, right? (The
addition looks fine to me, but just to understand if is it an omission
in the changelog, or an unintended change, or intended for another
reason).

Ah yes, I should've mentioned that! build_assert!() only works for stuff that can be const-optimized at build time, which requires inlining. Otherwise this change immediately causes build failures since generic variants of the functions get compiled (and since they're public functions, cannot be optimized out at link time).


Thanks!

Cheers,
Miguel


~~ Lina