lkml.org 
[lkml]   [2023]   [Mar]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v2] rust: ioctl: Add ioctl number manipulation functions
From
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

\
 
 \ /
  Last update: 2023-03-27 01:14    [W:0.025 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site