Re: [PATCH 04/79] block: rust: fix generation of bindings to `BLK_STS_.*`

Alice Ryhl
2026-03-16T09:27:39Z

On Mon, Feb 16, 2026 at 12:34:51AM +0100, Andreas Hindborg wrote:
> Bindgen generates constants for CPP integer literals as u32. The
> `blk_status_t` type is defined as `u8` but the variants of the type are
> defined as integer literals via CPP macros. Thus the defined variants of
> the type are not of the same type as the type itself.
>
> Prevent bindgen from emitting generated bindings for the `BLK_STS_.*`
> defines and instead define constants manually in `bindings_helper.h`
>
> Also remove casts that are no longer necessary.
>
> Signed-off-by: Andreas Hindborg <a.hindborg@kernel.org>

It'd be ideal to change the C header to use an enum, but that may not
work as I'm not sure you can specify the integer width you want for an
enum.

Reviewed-by: Alice Ryhl <aliceryhl@google.com>